You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use rb_ivar_get/rb_ivar_set to improve performance
By convert C-string to Ruby string ID each time, it will take a slightly time to call method each time.
This patch will catch the Ruby string ID to cut off the time.
* Before
```
Warming up --------------------------------------
query 886.000 i/100ms
each 67.339k i/100ms
fields 195.612k i/100ms
Calculating -------------------------------------
query 9.385k (± 4.5%) i/s - 46.958k in 5.016539s
each 901.633k (± 0.2%) i/s - 4.512M in 5.003951s
fields 3.779M (± 0.2%) i/s - 18.974M in 5.021533s
```
* After
```
Warming up --------------------------------------
query 845.000 i/100ms
each 86.916k i/100ms
fields 231.527k i/100ms
Calculating -------------------------------------
query 9.553k (± 2.0%) i/s - 48.320k in 5.059947s
each 1.133M (± 0.3%) i/s - 5.736M in 5.062606s
fields 6.319M (± 0.1%) i/s - 31.719M in 5.019960s
```
0 commit comments