-
Notifications
You must be signed in to change notification settings - Fork 544
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 ```
- Loading branch information
1 parent
c8c346d
commit d479969
Showing
3 changed files
with
20 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters