Re:Alpine makes Python Docker builds slower, and images larger
by shawn-butler on Thursday January 30, 2020 @02:21AM
(#22189557)
raw_allocator (string)
Which memory allocator to use for the PYMEM_DOMAIN_RAW allocator. Values can be jemalloc, rust, or system.
Important: the rust crate is not recommended because it introduces performance overhead.
From the docucmentation
Unfortunately, this requires building a custom binary linking jemalloc and calling into Python C APIs to configure the embedded interpreter and that's probably prohibitively too much effort for many users, who view the Python interpreter as a pre-built black box and therefore see musl's allocator as an unavoidable constant. Fortunately, tools like PyOxidizer exist to make this easier. (PyOxidizer supports using jemalloc as the allocator with a 1 line change and jemalloc can deliver even more performance than glib'c allocator.)