diff options
| author | bors <bors@rust-lang.org> | 2024-11-12 22:24:50 +0000 | 
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-11-12 22:24:50 +0000 | 
| commit | b420d923cff05f51eb43f607f5d8dce827eeba97 (patch) | |
| tree | 1e1342134d56ea67384939114fac670ac675b754 /tests/rustdoc-js-std/deduplication.js | |
| parent | f7273e0044ad8f35ad27282e4ab776af50b61a54 (diff) | |
| parent | fc8c16eb825cac02a5d8f5d9e5d6a2d4671a7922 (diff) | |
| download | rust-b420d923cff05f51eb43f607f5d8dce827eeba97.tar.gz rust-b420d923cff05f51eb43f607f5d8dce827eeba97.zip | |
Auto merge of #132870 - Noratrieb:inline-int-parsing, r=tgross35
`#[inline]` integer parsing functions
This improves the performance of `str::parse` into integers.
Before:
```
compare          fastest       │ slowest       │ median        │ mean          │ samples │ iters
╰─ std                         │               │               │               │         │
   ├─ 328920585  10.23 ns      │ 24.8 ns       │ 10.34 ns      │ 10.48 ns      │ 100     │ 25600
   ├─ 3255       8.551 ns      │ 8.59 ns       │ 8.551 ns      │ 8.56 ns       │ 100     │ 25600
   ╰─ 5          7.847 ns      │ 7.887 ns      │ 7.847 ns      │ 7.853 ns      │ 100     │ 25600
```
After:
```
compare          fastest       │ slowest       │ median        │ mean          │ samples │ iters
╰─ std                         │               │               │               │         │
   ├─ 328920585  8.316 ns      │ 23.7 ns       │ 8.355 ns      │ 8.491 ns      │ 100     │ 25600
   ├─ 3255       4.566 ns      │ 4.588 ns      │ 4.586 ns      │ 4.576 ns      │ 100     │ 51200
   ╰─ 5          2.877 ns      │ 3.697 ns      │ 2.896 ns      │ 2.945 ns      │ 100     │ 102400
```
Benchmark:
```rust
fn std(input: &str) -> Result<u64, ParseIntError> {
    input.parse()
}
```
Diffstat (limited to 'tests/rustdoc-js-std/deduplication.js')
0 files changed, 0 insertions, 0 deletions
