The files in this folder represent the profiling results for
fastnumbers functionality. The results are separated by Python version.
You can see what is being profiled in profile.py.
Some general observations about the results:
- The older the Python version, the greater the benefit
fastnumbersbrings over the built-in functionality. This is because the CPython maintainers are continiously making Python faster. - The conversion to floats is always faster than built-in functionality for Python <= 3.9. Starting with Python 3.10 some optimization was added that makes the conversion for small floats very fast.
- The conversion to integers is always faster than built-in functionality until the length of the input digit string is greater than 18 characters (the cut-off for 64-bit integers), at which point it is roughty tied to slightly slower than CPython.
- When numbers are provided (as opposed to strings), the Python built-ins are usually faster.
- If you need to convert a list of data, using the
mapoption is 2x faster than usingtry_*in a list comprehension, and about 1.5x faster than usingtry_*with the builtinmapfunction.- Returning an iterator and returning a list are quite similar in performance.
- If you need to convert a list of data to a
numpyarray,try_arrayis about 2x faster than using themapoption and then converting the resulting list to anndarray. Interestingly,try_arrayis only slightly faster than using themapoption by itself.