Live data from Hacker News

Flotsam: Insanely Fast Floating-Point Number Serialization for Java, Javascript

blog.factual.com

11–12 of 12 posts

Re: Flotsam: Insanely Fast Floating-Point Number Serialization for Java, Javascript

#11
post #8

Do the performance gains depend on how many digits before or after the decimal point there are?

No, this encoding uses a bitwise encoding for each float, so they are fixed at 10 characters each and encoded with constant speed (except possibly for subnormal numbers, which I've heard are slower in some environments).

Re: Flotsam: Insanely Fast Floating-Point Number Serialization for Java, Javascript

#12
Hah, I did almost the same thing recently! Precision and rounding was not that important though so i just went with log2 to get the exponent, normalize and cast to int to get the mantissa. Then I realized I could do it properly by just using a typed array :)
Post reply on HN