diff options
author | John Hawthorn <[email protected]> | 2024-02-11 21:43:38 -0800 |
---|---|---|
committer | John Hawthorn <[email protected]> | 2024-02-20 18:55:00 -0800 |
commit | 1c97abaabae6844c861705fd07f532292dcffa74 () | |
tree | a1d5dbac7eab32f6ffc168f1e556dfac085bc89a /vm_method.c | |
parent | 2a6917b463fa4065f26aea44802e2e24cc494e4c (diff) |
De-dup identical callinfo objects
Previously every call to vm_ci_new (when the CI was not packable) would result in a different callinfo being returned this meant that every kwarg callsite had its own CI. When calling, different CIs result in different CCs. These CIs and CCs both end up persisted on the T_CLASS inside cc_tbl. So in an eval loop this resulted in a memory of both types of object. This also likely resulted in extra memory used, and extra time searching, in non-eval cases. For simplicity in this commit I always allocate a CI object inside rb_vm_ci_lookup, but ideally we would lazily allocate it only when needed. I hope to do that as a follow up in the future.
-rw-r--r-- | vm_method.c | 114 |
1 files changed, 114 insertions, 0 deletions
@@ -333,6 +333,120 @@ invalidate_all_refinement_cc(void *vstart, void *vend, size_t stride, void *data return 0; // continue to iteration } void rb_clear_all_refinement_method_cache(void) { |