Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mimalloc support #483

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Mimalloc support #483

wants to merge 2 commits into from

Conversation

isty2e
Copy link
Contributor

@isty2e isty2e commented May 17, 2021

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.

@lightvector
Copy link
Owner

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

@isty2e
Copy link
Contributor Author

isty2e commented May 17, 2021

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 (microsoft/mimalloc#399), and setting the environment variable is a part of installation. Or one can consider statically linking it instead of using shared libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants