support loading libtcmalloc_minimal.dll for windows
Description
The effectiveness of tcmalloc has been discussed in several other threads.
For Windows, LD_PRELOAD is not available, but the tcmalloc_minimal module supported by gperftool can be compiled with patch type to use with Windows and perform hot patching already loaded modules.
How to compile/install tcmalloc_minimal
- git checkout https://github.com/gperftools/gperftools/
- install visual c++ 2022 + open cmd.exe and
cd go_to_gperfoools cd gperftools\vsprojects\libtcmalloc_minimalmsbuild /property:Configuration=Release-Patch- copy
x64\Release-Patch\libtcmalloc_minimal.dllto the top dir of webui
Notes
- some extensions will not work as expected with strange error msg. (e.g. Adetailer)
Checklist:
- [x] I have read contributing wiki page
- [x] I have performed a self-review of my own code
- [x] My code follows the style guidelines
- [x] My code passes tests
It’s working like a charm, thanks! I didn’t benchmark it computationally, but the workflow feels more lightweight. On my machine all extensions work as expected with no strange error msg.
Sidenote: The Visual Studio .sln project provided in the original repository of gperftools-2.16 was created with Visual Studio 2019 build tools v142. For a build with MSBuild version 17.13.19 (VS 2022) I edited the libtcmalloc_minimal.vcxproj file. In the PropertyGroup element: < PropertyGroup … 'Release-Patch|x64'> from v142 to < PlatformToolset >v143</ PlatformToolset>
built from the command line: msbuild vsprojects\libtcmalloc_minimal\libtcmalloc_minimal.vcxproj /property:Configuration=Release-Patch /p:platform=x64
OS: Windows11 Web Ui Version: v1.10.1