Working on bugs involving sprintf are difficult. We have a massive switch statement and a lot of complicated state toggling. We also have an implementation where parsing is done at the same time as outputting the result string. If parsing was in a separate phase we could save the parsing result to a cache (potentially even callsite caching it). We could also consider bytecode compiling it.
This is a significant addition to JRuby 9.4. It will minimally cache parsed format strings (if frozen) and we will add support for %a/%A. We also plan on fixing all tagged specs and MRI test suite failures.
Working on bugs involving sprintf are difficult. We have a massive switch statement and a lot of complicated state toggling. We also have an implementation where parsing is done at the same time as outputting the result string. If parsing was in a separate phase we could save the parsing result to a cache (potentially even callsite caching it). We could also consider bytecode compiling it.
This is a significant addition to JRuby 9.4. It will minimally cache parsed format strings (if frozen) and we will add support for %a/%A. We also plan on fixing all tagged specs and MRI test suite failures.