about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
diff options
context:
space:
mode:
authorTaras Tsugrii <taras.tsugriy@gmail.com>2023-07-31 12:40:11 -0700
committerTaras Tsugrii <taras.tsugriy@gmail.com>2023-07-31 12:40:11 -0700
commitb84942a0fe11c06a94cfe46ee787084e80c51fb9 (patch)
tree7c7ca0a7faeadc2f21d4a2af6974e2ad29ddbb55 /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
parentfb53384c94b87adebceb6048865c9fe305e71b92 (diff)
downloadrust-b84942a0fe11c06a94cfe46ee787084e80c51fb9.tar.gz
rust-b84942a0fe11c06a94cfe46ee787084e80c51fb9.zip
[rustc_data_structures][perf] Simplify base_n::push_str.
This minor change removes the need to reverse resulting digits.
Since reverse is O(|digit_num|) but bounded by 128, it's unlikely
to be a noticeable in practice. At the same time, this code is
also a 1 line shorter, so combined with tiny perf win, why not?

I ran https://gist.github.com/ttsugriy/ed14860ef597ab315d4129d5f8adb191
on M1 macbook air and got a small improvement
```
Running benches/base_n_benchmark.rs (target/release/deps/base_n_benchmark-825fe5895b5c2693)
push_str/old            time:   [14.180 µs 14.313 µs 14.462 µs]
                        Performance has improved.
Found 5 outliers among 100 measurements (5.00%)
  4 (4.00%) high mild
  1 (1.00%) high severe
push_str/new            time:   [13.741 µs 13.839 µs 13.973 µs]
                        Performance has improved.
Found 8 outliers among 100 measurements (8.00%)
  3 (3.00%) high mild
  5 (5.00%) high severe
```
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions