in 2019 a researcher at Microsoft wrote a paper called "Free List Sharding in Action" and proved that malloc has been slow this whole time
he built a drop-in replacement called 'mimalloc' and published the numbers
you have been using malloc since you started writing C
it works, it is fine, and it is leaving performance on the table
glibc malloc was designed to be general purpose across every possible allocation pattern that generality has a cost
it uses a single global free list per size class, protected by a lock
under any real multithreaded workload every thread is contending on the same lock
the fix is simple instead of one big free list per size class, give every 64KiB page its own free list each page also gets two separate lists: one for thread-local frees, one for frees coming from other threads
cross-thread frees become a single atomic compare-and-swap with no lock thread-local allocation never touches a lock at all
on the larson server benchmark mimalloc is 2.5x faster than tcmalloc and jemalloc under heavy multithreaded workloads on Linux it runs 5.3x faster than glibc malloc with 50% less resident memory
it is used in Death Stranding, Unreal Engine, NoGIL CPython 3.13, and Microsoft Bing Redis ships jemalloc by default but mimalloc benchmarks faster than jemalloc across most workloads
the fast path in the source is 7 instructions on x64 with a single conditional the comment in the source file says exactly this
The Japanese eat very little fat and suffer fewer heart attacks than the British or Americans...
The French eat a lot of fat and also suffer fewer heart attacks than the British or Americans.
The Japanese drink very little red wine and suffer fewer heart attacks than the British or Americans.
The Italians drink excessive amounts of red wine and also suffer fewer heart attacks than the British or Americans.
The Germans drink a lot of beers and eat lots of sausages and fats and suffer fewer heart attacks than the British or Americans.
Conclusion:
Eat and drink what you like.
Speaking English is apparently what kills you.
One of the biggest unlocks as a parent was realizing it's more important to teach your kids to fix problems they create rather than preventing them from creating problems at all.
For instance, my son put a small hole in the drywall horsing around with his friend.
Instead of just banning horse play, we went and got the spackle and puddy knife and I taught him how to patch drywall.
The time has come.
TaskSlinger launches into open beta today at 15:00 UTC.
A faster, cleaner task manager replacement for Windows, built from scratch for people who care about performance.
Get the free beta: https://t.co/pOVuGotRAK
One essential difficulty about programming is that while source code is essentially a tree, running code is essentially a graph.
This appears clearly when trying to offer "source level" runtime introspection tools.
Hey @GU_Music
I've bought a CD almost 3 weeks ago from you and since then there was silence from your side. No emails, no CD, ignoring my support emails.
Where is my CD?
I love using primary constructors in #dotnet, in a DI context in particular they provide a nice code 'tidy up'. And for anyone wondering why they aren't readonly well here's what Mads Torgersen said previously:
i saw a mouse with an X-shaped battery compartment.
first thought: this is stupid - who designed it?
5 seconds later: oh.
10 seconds later: OHHH!
the X slot fits an AA or an AAA battery - whichever you've got lying around.
the part most people miss is that the shape also makes it physically impossible to load both at once.
there is no warning label, no instructions and no way to screw it up.
the geometry does the thinking for you.
japanese has a word for this.
poka-yoke = "mistake-proofing."
the product refuses your stupidity before you can offer it.
i wish more things worked like this.
Atlus will upload permanent archives of Persona series live concerts from 2013, 2015, and 2017 for free on YouTube. The 2013 concert's archive will appear first tomorrow:
https://t.co/jF0dOsz2Zm
ODS, the unreasoned hatred of objects. This is a condition that many young software developers acquired because of the horrible abuses of objects that they saw in the field. Many of them adopted functional programming, and believe it is the antithesis of object programming. They are of course wrong.
I have been a functional programmer for the last 15 years. I still program with objects. I find the two techniques to be synergistic, not antagonistic.
I think many of the people infected with ODS would not consider the objects in my systems to be the kinds of hated objects that they saw in the field. That may in fact, be true. But the objects in my systems, reflect the original intent for objects.
My advice: drop the D and the S. Stop hating the O. Learn what the O really means. And then integrate that learning into your practice.