Conversation

Important but little-noticed effect of having a GC'd language: It forces the language devs to optimize memory allocation, because the language users can't do it themselves (at least, not nearly as easily). Lots of C++ users don't realize how fast malloc is in e.g. Java.
10
134
Replying to
I'm not sure if this is "pro-GC'd languge" or "anti-GC'd language", but C++ programs would probably spend ~25% less time in the allocator if it were tightly incorporated with the language runtime. (More if including sized deallocation, which most programs aren't compiled to use).
1
12
github.com/GrapheneOS/har is entirely focused on security but some of the concepts it uses would be very useful for a much different performance-oriented allocation design. On 64-bit you can reserve tons of address space as PROT_NONE even without overcommit and that changes things.
1
5