about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorRobin Kruppe <robin.kruppe@gmail.com>2015-12-30 14:01:42 +0100
committerRobin Kruppe <robin.kruppe@gmail.com>2016-01-12 22:25:16 +0100
commitdad1df6c1ab8fa06e9c5a28a6849e61fcdaa5008 (patch)
tree9308db8fdb5edc8f61960a41f7e74f43fb7d03e6 /src/rustllvm/RustWrapper.cpp
parent27a1834ce522e3ec7fe4726b1661de16ee30c503 (diff)
downloadrust-dad1df6c1ab8fa06e9c5a28a6849e61fcdaa5008.tar.gz
rust-dad1df6c1ab8fa06e9c5a28a6849e61fcdaa5008.zip
Speed up dec2flt fast path with additional tables.
Add tables of small powers of ten used in the fast path. The tables are redundant: We could also use the big, more accurate table and round the value to the correct type (in fact we did just that before this commit). However, the rounding is extra work and slows down the fast path.

Because only very small exponents enter the fast path, the table and thus the space overhead is negligible. Speed-wise, this is a clear win on a [benchmark] comparing the fast path to a naive, hand-optimized, inaccurate algorithm. Specifically, this change narrows the gap from a roughly 5x difference to a roughly 3.4x difference.

[benchmark]: https://gist.github.com/Veedrac/dbb0c07994bc7882098e
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions