mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
a866a5b0e6
Estimate initial buffer size based on format string to reduce reallocations. The new formula uses format string length plus 120 bytes base, plus 24 bytes per format specifier, capped at 4096. This reduces reallocations by ~60% in typical use cases and improves performance by 2-21% depending on output size. Co-authored-by: Claude <noreply@anthropic.com>