mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
a07d9fb62c
- Add mrb_likely/mrb_unlikely macros to common.h for branch prediction - Optimize OP_GETIDX array fast path: - Cache RArray pointer to avoid repeated RARRAY() calls - Single ARY_EMBED_P check instead of two (via RARRAY_LEN + RARRAY_PTR) - Use unsigned comparison for bounds check - Add branch prediction hints for common cases - Convert switch statement to if-else chain for better branch prediction Benchmark shows ~3% improvement for array read operations. Co-authored-by: Claude <noreply@anthropic.com>