Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In C++ land, I've actually rolled std::pmr with jemalloc in order to have better allocator than OS one, be clean, and avoid global hooks [1]

Two big issues were found (and some others):

   - std::pmr:: introduces news types - e.g. std::pmr::string is different than std::string

   - std::string becomes much more expensive, especially for small strings, as there is 8 bytes added for each such strings to keep the pmr allocator.
So we removed this code, and went back to a globally hooked allocator (mimalloc in our case) - targeting Windows mostly.

[1] - Globally hooked allocators are magic: mimalloc, tbbmalloc, google's, etc. The issue becomes apparent when you try to use now optimized code in a different host - for example you have 3D model exporter that works great in your tools, but poorly under 3DSMax or Maya where a different global allocator is used, and no longer works as expected.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: