mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Add a fast-path for mrb_type
By adding a fast-path where we ignore boxed types we can gain a pretty substantial speedup of mrb_iv_get, making it about 25% faster during a standard optcarrot benchmark run. NOTE: It is just mrb_iv_get that is that much faster, the whole benchmark seems to be about 3-5% faster with word boxing.
This commit is contained in:
+1
-1
@@ -282,7 +282,7 @@ mrb_vm_special_set(mrb_state *mrb, mrb_sym i, mrb_value v)
|
||||
static mrb_bool
|
||||
obj_iv_p(mrb_value obj)
|
||||
{
|
||||
switch (mrb_type(obj)) {
|
||||
switch (mrb_unboxed_type(obj)) {
|
||||
case MRB_TT_OBJECT:
|
||||
case MRB_TT_CLASS:
|
||||
case MRB_TT_MODULE:
|
||||
|
||||
Reference in New Issue
Block a user