diff options
author | Alan Wu <[email protected]> | 2024-07-19 15:53:16 -0400 |
---|---|---|
committer | Alan Wu <[email protected]> | 2024-07-19 17:47:12 -0400 |
commit | 8cf708d7b495f62d6239a49af25c362d0156e6aa (patch) | |
tree | 680e215418a2555119c0b8413bff7b872162dbb2 /error.c | |
parent | 30f2d69825ff402bbff0398dcf4f5ab8a6e62c7f (diff) |
Make rb_check_frozen_inline() static inline again
Since 730e3b2ce01915c4a98b79bb281b2c38a9ff1131
("Stop exposing `rb_str_chilled_p`"), we noticed a speed loss on a few
benchmarks that are string operations heavy. This is partially due to
routines no longer having the options to inline rb_check_frozen_inline()
in non-LTO builds. Make it an inlining candidate again to recover speed.
Testing this patch on my machine, the fannkuchredux benchmark gets a
1.15 speed-up with YJIT and 1.03 without YJIT.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/11211
Diffstat (limited to 'error.c')
-rw-r--r-- | error.c | 8 |
1 files changed, 1 insertions, 7 deletions
@@ -4001,13 +4001,7 @@ rb_error_frozen_object(VALUE frozen_obj) void rb_check_frozen(VALUE obj) { - if (RB_UNLIKELY(RB_OBJ_FROZEN(obj))) { - rb_error_frozen_object(obj); - } - - if (RB_UNLIKELY(CHILLED_STRING_P(obj))) { - rb_str_modify(obj); - } + rb_check_frozen_inline(obj); } void |