KataGo icon indicating copy to clipboard operation
KataGo copied to clipboard

Mimalloc support

Open isty2e opened this issue 4 years ago • 2 comments

This pull request adds the support for mimalloc, a better memory allocator. It has been claimed by authors that this outperforms other allocators including TCMalloc, but whether this applies to KataGo as well is beyond me.

I have confirmed that this can be built and run on both Windows and *NIX systems. Due to the problem of mimalloc itself, ld cannot correctly search the shared library file when mimalloc is installed with make install in *NIX, and LD_LIBRARY_PATH should be set properly (like export LD_LIBRARY_PATH=/usr/local/lib/mimalloc-1.7/:$LD_LIBRARY_PATH) before running KataGo.

Presumably the official windows binary can be built with this, and mimalloc-override.dll, mimalloc-redirect.dll, and a corresponding license file can be provided.

isty2e avatar May 17 '21 06:05 isty2e

Cool, thanks. Is there any way to make the LD library path thing part of the cmake setup?

lightvector avatar May 17 '21 12:05 lightvector

Cool, thanks. Is there any way to make the LD library path thing part of the cmake setup?

I am not sure, but I consider it a problem of mimalloc itself (https://github.com/microsoft/mimalloc/issues/399), and setting the environment variable is a part of installation. Or one can consider statically linking it instead of using shared libraries.

isty2e avatar May 17 '21 13:05 isty2e