mirror of
https://github.com/ruby/ruby.git
synced 2025-08-25 22:14:37 +02:00
![]() `rb_cstr2inum` isn't very fast because it handles tons of different scenarios, and also require a NULL terminated string which forces us to copy the number into a secondary buffer. But since the parser already computed the length, we can much more cheaply do this with a very simple function as long as the number is small enough to fit into a native type (`long long`). If the number is too long, we can fallback to the `rb_cstr2inum` slowpath. Before: ``` == Parsing citm_catalog.json (1727030 bytes) ruby 3.4.0dev (2024-11-06T07:59:09Z precompute-hash-wh.. |
||
---|---|---|
.. | ||
depend | ||
extconf.rb | ||
parser.c | ||
parser.rl | ||
prereq.mk |