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
{{ message }}
Repository navigation
The cppia JIT's executable-memory probe slows jitted loops and calls by about 9% #368
Since 9d64e1d57a8074926e9139a09d0234458a1b1a93 (#266), the cppia JIT checks once whether it can get executable memory before it compiles anything. It does that by allocating 16 bytes through sljit's executable allocator and freeing them. That leaves the allocator's free list as if a function had been made and freed, which moves where every function compiled after it goes. On Windows the jitted benchmarks lost about 9%.
The bench suite, Windows x64, MSVC 19.44, Haxe 4.3.7, three processes of ten samples per point, measured on its own in commit order:
Commit
cppia_jit_int_loop
cppia_jit_native_call
d7345655, the commit before
748M iterations/s
608M calls/s
9d64e1d5
696M
552M
main at e621f756
678M to 706M
548M to 553M
main with the probe left out
738M
609M
The same machine measured main against a copy of itself within 1% on these benchmarks, so the drop is not noise. cppia_jit_virtual_call was unaffected.
The code the JIT generates did not change; only its placement did, and tight loops and calls are sensitive to that. The fix probes by mapping and releasing one chunk directly, the way sljit's allocator maps its own memory, MAP_JIT included on Apple, so the allocator's state is as it was without a probe. Falls back to the old probe where sljit's executable allocator is not built in.
cppia_jit_alloc_objects also fell, from 102M to about 96M objects/s, with peak memory up from 23.4 MB to 27.6 MB. It does not recover with this fix, so it has another cause, which is being looked at separately.
Activity
Publish the benchmark tables for 72eedd0