[erlang-questions] io_lib:format R16B03 performance and jsx impact

Lukas Larsson lukas@REDACTED
Tue Jan 28 10:54:01 CET 2014


Hello,

The code for formatting float when doing it through io_lib:format it
written in pure Erlang. The reason that io_lib:format is implemented in
Erlang is because it allows much greater cross platform formatting
capabilities, alas at the cost of performance.

Why you see a performance drop in between R15B03 to R16B03 I don't know, if
you could create a minimal reproducible benchmark that shows the difference
that would be great.

If you want to have a speedy conversion of something you know is a float to
a textual format you should use float_to_list/binary as that is meant to be
a fast conversion, but with less flexibility.

Lukas


On Tue, Jan 28, 2014 at 10:05 AM, Max Lapshin <max.lapshin@REDACTED> wrote:

> btw, why io_lib:format is so slow? simple changing it to nif with fprintf
> reduces cpu a lot.
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140128/8fbceb6c/attachment.htm>


More information about the erlang-questions mailing list