Add obj_need_obj_free_p - #99
Open
peterzhu2118 wants to merge 1 commit into
Open
Conversation
We don't need to call obj_free on certain types of objects anymore including
T_FLOAT, T_RATIONAL, T_COMPLEX, and T_OBJECT. It makes freeing those objects
faster.
Benchmark:
i = 0
while i < 10_000_000
Object.new
i += 1
end
Before:
Time (mean ± σ): 1.435 s ± 0.013 s [User: 1.706 s, System: 1.970 s]
Range (min … max): 1.418 s … 1.461 s 10 runs
After:
Time (mean ± σ): 1.230 s ± 0.027 s [User: 1.335 s, System: 1.743 s]
Range (min … max): 1.206 s … 1.294 s 10 runs
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We don't need to call obj_free on certain types of objects anymore including T_FLOAT, T_RATIONAL, T_COMPLEX, and T_OBJECT. It makes freeing those objects faster.
Benchmark:
Before:
After: