mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
7feba44aa3
Add dc_to_s_scratch_t structure to preallocate work buffers for the base case of divide-and-conquer decimal string conversion. This eliminates repeated malloc/free calls in the inner loop where digits are extracted 9 at a time. Previously, each iteration of the base case loop allocated and freed a quotient buffer. Now the same two buffers are reused with pointer swapping, reducing allocation overhead by ~10-18% for large numbers. Co-authored-by: Claude <noreply@anthropic.com>