Skip to content

Exponential Performance Regression in Rust 1.73 Read API from BorrowedCursor::ensure_init #117545

Closed
@PSeitz

Description

@PSeitz

Reported by a lz4_flex user PSeitz/lz4_flex#147

Code

I created a small repo to demonstrate on a minimal example.
https://github.com/PSeitz/copy_regression_1.73

BorrowedCursor::ensure_init from this PR #97015 seems exhibit exponential cost.

The program creates a Vec and reads it in chunks of 32kb. Size is specified as a command line argument (100MB-400MB).

time cargo run --release 100000000 (If your default is 1.73)

Executed in    3.84 secs    fish           external
   usr time    3.80 secs  268.00 micros    3.80 secs
   sys time    0.03 secs  262.00 micros    0.03 secs

time cargo run --release 200000000

Executed in   16.90 secs    fish           external
   usr time   16.82 secs  626.00 micros   16.82 secs
   sys time    0.04 secs    0.00 micros    0.04 secs

time cargo run --release 400000000

Executed in   72.84 secs    fish           external
   usr time   72.65 secs  586.00 micros   72.65 secs
   sys time    0.06 secs  138.00 micros    0.06 secs

time cargo +1.72 run --release 100000000

Executed in   57.23 millis    fish           external
   usr time   16.83 millis  404.00 micros   16.43 millis
   sys time   37.02 millis    0.00 micros   37.02 millis

time cargo +1.72 run --release 400000000

Executed in  257.30 millis    fish           external
   usr time  150.46 millis  477.00 micros  149.98 millis
   sys time  106.64 millis  112.00 micros  106.53 millis

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions