Thorium-Win
Thorium-Win copied to clipboard
Build with mimalloc to further improve browser performance
Is your feature request related to a problem? Please describe.
mimalloc
is a high-performance memory allocator alternative to glibc malloc().
In Linux, it can be easily enabled as a drop-in replacement of glibc malloc().
In Windows, it has to be compiled together with the target project.
Describe the solution you'd like, including relevant patches or source
Compile Thorium-Win with mimalloc
enabled.
https://github.com/microsoft/mimalloc?tab=readme-ov-file#override_on_windows
Additional Notes Add any other context or screenshots about the feature request here.
Introducing mimalloc into Chromium compilation requires a lot of work. It seems that no developers are doing this at this stage, but it would be good if it can be done.
@enihcam This is something I would like to do, based on their benchmarks, however, getting this to work in Thorium, and for all the platforms (Linux, Windows, MacOS, Android, ChromiumOS) would take alot of work. @gz83 Perhaps with a .patch file and a script that uses sed
and grep
to replace all instances of malloc in the code with mimalloc. I can look into it. However, there is also the possibility that it would cause bugs, since although we use the gcc malloc function, Chromium is compiled with LLVM/Clang, not the GCC/G++ toolchain.
Getting it to work wouldn't necessarily make Thorium any faster at web rendering, but it would load faster on initial startup, and would be able to spawn renderer processes faster, due to memory loading occurring quicker.
malloc is a relic from very early Linux and very early C compilers. I think maybe it is starting to show its age, and isn't scaling well with the large sizes and multi-threads of today's applications.
@Alex313031 @gz83 Glad to hear you are considering this.
Maybe you can start from trying Dynamically overriding first?
We may try, but there is no guarantee that mimalloc will be used and Chromium's compilation workflow does not support us using mimalloc directly.