Page 1 of 1

Better memory allocator for Linux(and Windows and Mac)

Posted: Sat Apr 18, 2020 12:45 am
by DeltaKilo
So I tested memory allocators under Linux, and that's the results

I used best of 3 results here, because I testing it on Laptop between latest and greatest glibc which is default, and Microsoft experimental labs MiMalloc.

It has 7.2% difference over 5000 ticks of Nefrums 100% Achievement map, hey Oxyd, Linux memory allocator is better than Windows' but I can't benchmark it there, can you link https://github.com/microsoft/mimalloc linked to executable on other platforms than Linux to measure the performance gain.

7.2% is a serious thing when we speak about megabases or mods even without linux huge pages.

Re: Better memory allocator for Linux(and Windows and Mac)

Posted: Sat Apr 18, 2020 12:50 am
by DeltaKilo
I can plug different memory allocator with a command on Linux:

Code: Select all

LD_PRELOAD="/usr/lib64/mimalloc-1.6/libmimalloc.so.1.6" perf stat factorio --benchmark-ticks 5000 --benchmark ~/.factorio/saves/6_49_05.zip

Re: Better memory allocator for Linux(and Windows and Mac)

Posted: Wed Jul 15, 2020 9:33 pm
by posila
Not a bug, but it might be worth exploring (even though I'd rather reduce number of heap allocations during update, or eliminate all allocations that for things that don't persist until next update)