elixir-lang/elixir — pull request #1775 by cblage (2013-10-19 22:21:02+00:00)
Title: Elixir native and fast number parsing for Floats and Integers

The current solution for Integer.parse and Float.parse rely on converting the entire binary string into a charlist, passing it to the erlang native parser and converting back into binary the remainder that the erlang native parser returns.

When processing big strings, and trying to parse multiple floats / integers in a tight loop, this can cause severe performance degradation due to all the conversions from binary to charlist and vice-versa (it triggers the gc, and makes things very slow).

I ran into this issue while implementing [Elixir JSON](https://github.com/cblage/elixir-json). My interim solution was converting all binary strings into charlists once when entering the library, but this is not the optimal solution. I would much rather prefer using the Elixir primitives without worrying :)

Cheers,
Carlos