[erlang-questions] new float_to_list/2 BIF - critique wanted
Gleb Peregud
gleber.p@REDACTED
Sun May 3 17:31:23 CEST 2009
On Sun, May 3, 2009 at 17:15, Per Melin <per.melin@REDACTED> wrote:
> Gleb Peregud:
> Yes! I cannot overstate how much I would appreciate a BIF like this.
>
> Dealing with large amounts of financial instrument information, where
> response times and latency must be low, the lack of a fast usable
> float_to_list is a huge pain.
I feel the same way with GIS data, where coordinates are stored as
floats. Example:
mochinum:digits/1 gave me throughput of 5kBps
io_lib:format/2 gave c.a. 300kBps
float_to_list/1 gave me c.a. 450kBps, but HUGE overhead in size of
resulting JSON
float_to_list/2 gave me c.a. 500kBps with optimal size of the
resulting coordinates representation in JSON
I'm waiting for critique, so the chance of it being accepted is as
high as possible :) Currently I'm concerned about probably excessive
buffer sizes and the way of creating format string "%.NNe", where NN
is precision. How can it be improved?
The implementation is stored here:
http://github.com/gleber/erlang-otp/tree/float_to_list_2
--
Gleb Peregud
http://gleber.pl/
Every minute is to be grasped.
Time waits for nobody.
-- Inscription on a Zen Gong
More information about the erlang-questions
mailing list