mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
6544195c43
Reorganize switch statement cases in pack and unpack functions by grouping formats with similar function signatures together. This improves branch prediction and CPU pipeline efficiency by reducing branch misprediction overhead in the hot dispatch paths. Key improvements: - Pack dispatch: grouped by signature patterns (integer, float, string) - Unpack dispatch: optimized both COUNT2 and element-by-element switches - Better instruction cache usage through logical code organization - Enhanced branch prediction for frequently used format combinations - Maintained full backward compatibility with all existing functionality Co-authored-by: Claude <noreply@anthropic.com>