diff options
author | chai <chaifix@163.com> | 2021-12-01 13:34:22 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-12-01 13:34:22 +0800 |
commit | 09abf1b529b4226f585ecfbb20866715b901755b (patch) | |
tree | 16929f2a6bee3ad4667bdd006cfcc1e683ab7210 /Client/ThirdParty/fpm/docs/performance.md | |
parent | 84d961f754c905b37420f4d1b3fee8f4e523e58a (diff) |
+fpm
Diffstat (limited to 'Client/ThirdParty/fpm/docs/performance.md')
-rw-r--r-- | Client/ThirdParty/fpm/docs/performance.md | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Client/ThirdParty/fpm/docs/performance.md b/Client/ThirdParty/fpm/docs/performance.md new file mode 100644 index 0000000..b4b0b2f --- /dev/null +++ b/Client/ThirdParty/fpm/docs/performance.md @@ -0,0 +1,21 @@ +# Performance + +The image below shows the approximate performance of: +* `fpm` (the `Q16.16` type) +* [libfixmath](https://github.com/PetteriAimonen/libfixmath) (`fix16`), an alternative C library (see [notes](#notes)). +* [Compositional Numeric Library](https://github.com/johnmcfarlane/cnl) (`CNL`), an experimental library that is being developed in C++'s [SG14](https://github.com/WG21-SG14/SG14). +* native FPU operations (`float` and `double`). + +The graph below plots the average number of nanoseconds a single operation takes: lower is better. The data was collected with [Google Benchmark](https://github.com/google/benchmark) on an Intel Core i7-5820K, 3.3GHz. + + + +The results show the following: +* Compared to `libfixmath`, the performance of `fpm` is at least as good, except for `exp`, where it's considerably slower. +* Compared to CNL, `fpm` only matches the performance for `sqrt`. However, CNL does not support the majority of benchmarked functions. +* Compared to native single-precision floating-point operations, `fpm` is slower by up to an order of magnitude for most functions, except for the basic `add`, `sub` and several power or trigonometry functions, where it is faster. + +## Notes + +For a fair comparison, `libfixmath` was compiled with `FIXMATH_NO_CACHE`. +It should also have been compiled with `FIXMATH_NO_OVERFLOW` (since `fpm` does not detect overflow), but `libfixmath` failed to compile with that option. |