diff options
author | Miguel Saldivar <miguel.saldivar@hpe.com> | 2025-09-03 02:24:21 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-03 10:24:21 +0100 |
commit | be1e50f56af8e270a0396eef8f62626fbbb84996 (patch) | |
tree | 2f3b2909b4c32149e40591214bb49e44ab011aaf /mlir/lib/CAPI | |
parent | 759a2ac5b0ee09be9dbb51ad50143d7db990a94a (diff) | |
download | llvm-main.zip llvm-main.tar.gz llvm-main.tar.bz2 |
Going through and doing `convertToAttribute` for all elements, if they
are the same can be costly. If the elements are the same, we can just
call `convertToAttribute` once.
This does give us a significant speed-up:
```console
$ hyperfine --warmup 1 --runs 5 ./slow.sh ./fast.sh
Benchmark 1: ./slow.sh
Time (mean ± σ): 1.606 s ± 0.014 s [User: 1.393 s, System: 0.087 s]
Range (min … max): 1.591 s … 1.628 s 5 runs
Benchmark 2: ./fast.sh
Time (mean ± σ): 452.9 ms ± 7.6 ms [User: 249.9 ms, System: 83.3 ms]
Range (min … max): 443.9 ms … 461.7 ms 5 runs
Summary
./fast.sh ran
3.55 ± 0.07 times faster than ./slow.sh
```
Fixes #125444
Diffstat (limited to 'mlir/lib/CAPI')
0 files changed, 0 insertions, 0 deletions