Compare commits

...

No commits in common. "398c2c94109b6969c9f75311a3b8af1ce988a341" and "8e36dacc12e5e239b23640441e5da51315ffcfb4" have entirely different histories.

1 changed files with 50 additions and 0 deletions

50
icu/readme.md Normal file
View File

@ -0,0 +1,50 @@
# UTF-8 Benchmark
The idea is to benchmark several utf-8 aspects of the Haskell Text package. Namely utf-8 encoding/decoding and various unicode casing operations. Hopefully, we'll find ways to improve text's performance.
For the time being, we're comparing the Text implementation with the C ICU one. In the future I also plan to test it against C++ Boost and the Rust stdlib.
# Implemented so far
- [x] UTF-8 decoding from file.
- [x] English
- [ ] Chinese
- [ ] French
- [ ] Russian
- [ ] UTF-8 encoding to file.
- [ ] English
- [ ] Chinese
- [ ] French
- [ ] Russian
- [ ] UTF-8 encoding to file.
- [ ] English
- [ ] Chinese
- [ ] French
- [ ] Russian
# Usage
```bash
nix-shell
make all
```
# Findings
## UTF-8 Decoding
```
hyperfine ./haskell-read-utf8 ./icu-read-utf8
Benchmark #1: ./haskell-read-utf8
Time (mean ± σ): 23.3 ms ± 0.9 ms [User: 14.9 ms, System: 8.3 ms]
Range (min … max): 22.0 ms … 26.1 ms 111 runs
Benchmark #2: ./icu-read-utf8
Time (mean ± σ): 12.5 ms ± 0.8 ms [User: 7.6 ms, System: 4.9 ms]
Range (min … max): 11.5 ms … 16.1 ms 176 runs
Summary
'./icu-read-utf8' ran
1.85 ± 0.14 times faster than './haskell-read-utf8'
```