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
GC heap does not grow; HXCPP_MINIMUM_WORKING_MEMORY is ignored (allocation ~3x slower than stock) #230
libhxcpp's GC heap does not grow the way stock hxcpp's does. Under allocation-heavy load it stays at about 5 MB reserved, while stock hxcpp 4.3.53 grows to about 21 MB on the same program. libhxcpp therefore collects roughly four times as often, which makes allocation-heavy code about 3x slower than stock.
HXCPP_MINIMUM_WORKING_MEMORY is also ignored: with it set to 200 MB, libhxcpp still reserves about 5 MB, while stock reserves about 208 MB.
Measurements
From the benchmark suite in bench/ (Windows 11, Ryzen 9 9950X, MSVC 19.44, 64-bit, 3 processes x 10 samples, same sources and compiler flags for both runtimes, matching checksums):
Benchmark
libhxcpp vs stock 4.3.53 (throughput)
alloc_small
0.29x
map_int
0.33x
alloc_arrays
0.35x
string_build
0.65x
Setting
libhxcpp reserved
stock reserved
defaults
~5 MB
~21 MB
HXCPP_MINIMUM_WORKING_MEMORY=200000000
~5 MB
~208 MB
With a 208 MB heap, stock's speed is unchanged, so collections themselves are cheap there; libhxcpp is paying for collecting far more often.
The sizing defaults and the sizing formula match stock, so the difference is in where the computed size is applied.
Reproduce
cd bench
haxe --run Run --only alloc_small,alloc_arrays,map_int
Severity
High (performance). Affects every allocation-heavy program, and makes the minimum working memory setting a no-op.
Activity
Let the heap grow when the allocator refills its free list
Let the heap grow when the allocator refills its free list