jcrist · GitHub

@jcrist

This refactors the number parsing routine (str -> int/float), with the
following results:
- Improved performance, up to 20% faster, dependent on message. This is
  most prominent for floats or long ints.
- Ability to reuse the same routine for converting strings to ints or
  floats (or int/float-like things). Previously we had a duplicate
  `str -> int` routine, and relied on cpython's float parser for the
  `str -> float` conversions. With this change we're able to delete a
  bunch of code.
- Expanded features. In particular, we can now support float-like
  strings as dict keys in JSON.
- Improved maintainability. The reorganized code should provide a better
  base to build new features off of.

Read the original on github.com ↗