Add optimized (smaller) lookup table for float type parsing#103
Add optimized (smaller) lookup table for float type parsing#103jrahlf wants to merge 2 commits intofastfloat:mainfrom
Conversation
…files to test/benchmark code sizes. Add script to generate float lookup table.
|
Since one goal is to eventually move this library toward supporting Certainly, anything that increases the binary bloat of the general case does not move us in the right direction, I think. The idea of better supporting the isolated use case ( Cheers! |
|
fmt has many config macroses that improve performance and size. Like this, PR functionality can be added by FMT_USE_FLOAT, FMT_USE_DOUBLE, FMT_USE_LONG_DOUBLE. I definitely understand why jrahlf want to add this table. It is very useful for gaming, embedded, and other places in industry. Also, I'm still working on the #307 . P. S. After all, float128 also needs optimisation and realisation in the library because it exists since 2008 in IEEE and the community already added this type to boost library, for example. It's all real usage types. |
Reduce code size if only float accuracy is needed for parsing, implements #99
Pro:
floattype is used for parsing (numbers are discussed in optimized (smaller) lookup table for float (binary32 only) #99)Con:
doubleandfloattypes are used for parsingThe correct LUT is selected in
compute_product_approximation, depending on the bit_precision.Currently it selects the float LUT, if the bit_precision is smaller than 27. I actually do not like this switch, do you have a better proposal?
Adds: