logoalt Hacker News

marcosdumaytoday at 2:34 PM5 repliesview on HN

> That's when you measure and optimize.

How do you "optimize" the GC away after you wrote your entire database server in a language that uses it?


Replies

ApolloFortyNinetoday at 2:49 PM

It's incredibly in common in game development, C# has a lot of features you can take advantage for this.

But the most naive example any language supports is simple object pooling.

Then more fancy, zero allocations tasks in C# https://github.com/cysharp/unitask

marginalia_nutoday at 3:50 PM

Object pooling and bump allocators using persistent scratch buffers, mostly. The latter what you'd use for read buffers in I/O intensive applications like databases and the like.

pjmlptoday at 4:35 PM

Starting by using a GC language that is strongly typed, compiles to native code, supports value types, memory pools/arenas if required, which provides best of both worlds.

Where GC means any kind of GC algorithm from CS point of view.

jmulltoday at 3:01 PM

GC languages typically have features of the language and/or standard library that make GC the default, not the only option.

show 1 reply
jayd16today at 3:33 PM

Lots of ways but an obvious and generic answer is to use pooling.