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

Usually when you want to manual memory management it's for two reasons:

1. You have more domain knowledge about the objects you're creating so you can special case and beat malloc()/free()(which can be extremely painful in some cases).

2. You need to control the memory layout of your objects so that the data access patters line up with memory layout. The speed improvements here are on the order of 50-100x depending on your case.

Usually(but not always) GC'd languages don't give you value types that let you do #2. C# and a few others happen to be a nice exception. If you're using Java you end up being out of luck unless you decided to leverage a library that provides views into byte buffers like FlatBuffers. Although then you pay the indirection costs.

I haven't worked much with Go to know if it supports composing values types like C# but when we talk about performance that's usually what crosses a lot of GC'd languages from my list.



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

Search: