Update 'Performance'

master
John Zacarias Jekel 1 year ago
parent fbc901882c
commit b9c1406960
  1. 16
      Performance.md

@ -1,23 +1,25 @@
# Summary
| Anslatortray Version | Time* in UTF-8 mode (ns) | Time* in ASCII mode (ns) |
| Anslatortray Version | Time* in Regular mode (ns) | Time* in Byte-String Mode (ns) |
| -------- | -------- | -------- |
| main branch | 122.298 | 69.564 |
| 0.4.0 | 128.971 | 93.986 |
| 0.3.0 | 227.462 | N/A |
| main branch | 40.27 | 40.25 |
| 0.4.0 | 128.971 (old UTF-8 mode) | 93.986 (old ASCII mode) |
| 0.3.0 | 227.462 (old UTF-8 mode) | N/A |
\* The time to translate the average word in the `words_alpha.txt` file from <https://github.com/dwyl/english-words>.
# Test results for the current Anslatortray main branch
On my dated system with dual Intel(R) Xeon(R) E5-2670 v2 CPUs, the `translate()` function can process one word every **122.298** nanoseconds on average in the default UTF-8 mode, and one word every **69.564** nanoseconds on average in the ASCII-only mode. The `words_alpha.txt` file from <https://github.com/dwyl/english-words> was fed to the `anslatortray --benchmark-file` set to 1000 iterations, and then the averages produced were divided by 370105 (the number of words in the file).
From Anslatortray 0.4.0 to 0.5.0, the ASCII translation functions were removed, as were the UTF-8 translation functions. Instead, there are new "byte string" functions that operate on u8 slices and Vecs. In addition to being exposed to the user directly, they are also used to power the "regular" (originally called UTF-8) translation functions.
On my dated system with dual Intel(R) Xeon(R) E5-2670 v2 CPUs, the `translate()` function can process one word every **40.27** nanoseconds on average in regular mode, and one word every **40.25** nanoseconds on average in byte string mode. The `words_alpha.txt` file from <https://github.com/dwyl/english-words> was fed to the `anslatortray --benchmark-file` set to 1000 iterations, and then the averages produced were divided by 370105 (the number of words in the file).
```
> anslatortray --benchmark-file ./words_alpha.txt 1000
Anslatortray: frontend for the Anslatortray for Rust library
Sucessful: UTF-8 translation took 45263257ns to translate on average over 1000 runs.
Sucessful: ASCII translation took 25746150ns to translate on average over 1000 runs
Sucessful: Regular translation took 14903753ns to translate on average over 1000 runs.
Sucessful: Byte-string translation with reused allocations took 14897940ns to translate on average over 1000 runs.
```
# Test results for Anslatortray 0.4.0
From Anslatortray 0.3.0 to 0.4.0, the various included programs were consolidated into a single `anslatortray` binary. In addition, this binary recieved a new option `--benchmark-file`, which makes it much easier to evaluate the time it takes to translate a particular file.

Loading…
Cancel
Save