diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2020-04-30 23:58:50 -0700 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2020-05-01 01:38:16 -0700 |
commit | 818d6d33368a396d9cd3d1a34a84015a9e76c5c8 (patch) | |
tree | 594ed5f3d04ee24df7b0db67ffbeaa11f612eb78 /mjit.c | |
parent | 773afeb73d658129ddeb0a89ddb7e2ea49165a1d (diff) |
Deduplicate functions in compacted JIT code
to improve code locality.
Using benchmark-driver/sinatra with 100 methods JIT-ed,
[Before] 12149.97 rps
1.3M /tmp/_ruby_mjit_p31171u145.so
[After] 12818.83 rps
260K /tmp/_ruby_mjit_p32155u145.so
(VM is 13714.89 rps)
Diffstat (limited to 'mjit.c')
-rw-r--r-- | mjit.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -191,7 +191,7 @@ free_list(struct rb_mjit_unit_list *list, bool close_handle_p) if (unit->handle && dlclose(unit->handle)) { mjit_warning("failed to close handle for u%d: %s", unit->id, dlerror()); } - clean_object_files(unit); + clean_temp_files(unit); free(unit); } else { @@ -889,7 +889,7 @@ skip_cleaning_object_files(struct rb_mjit_unit_list *list) // No mutex for list, assuming MJIT worker does not exist yet since it's immediately after fork. list_for_each_safe(&list->head, unit, next, unode) { #ifndef _MSC_VER // Actually mswin does not reach here since it doesn't have fork - if (unit->o_file) unit->o_file_inherited_p = true; + if (unit->c_file) unit->c_file_inherited_p = true; #endif #if defined(_WIN32) // mswin doesn't reach here either. This is for MinGW. |