summaryrefslogtreecommitdiff
path: root/include/ruby
diff options
context:
space:
mode:
authorAlan Wu <[email protected]>2024-07-19 15:53:16 -0400
committerAlan Wu <[email protected]>2024-07-19 17:47:12 -0400
commit8cf708d7b495f62d6239a49af25c362d0156e6aa ()
tree680e215418a2555119c0b8413bff7b872162dbb2 /include/ruby
parent30f2d69825ff402bbff0398dcf4f5ab8a6e62c7f (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 on my machine, the fannkuchredux benchmark gets a 1.15 speed-up with YJIT and 1.03 without YJIT.
Notes: Merged: https://.com/ruby/ruby/pull/11211
-rw-r--r--include/ruby/internal/intern/error.h20
1 files changed, 19 insertions, 1 deletions
@@ -237,6 +237,8 @@ RBIMPL_ATTR_NORETURN()
*/
void rb_error_arity(int argc, int min, int max);
RBIMPL_SYMBOL_EXPORT_END()
/**
@@ -247,7 +249,23 @@ RBIMPL_SYMBOL_EXPORT_END()
#define rb_check_frozen_internal rb_check_frozen
/** @alias{rb_check_frozen} */
-#define rb_check_frozen_inline rb_check_frozen
/**
* Ensures that the passed integer is in the passed range. When you can use