Hacker News new | past | comments | ask | show | jobs | submit login

> That helped some but a Nginx/LuaJIT implementation of the same solution still crushed it on the same box, identical workload.

That's very interesting because LuaJIT has GC as well. Could you please reveal a bit more about the type of application, number of lines, and if the code is public?




Sadly it's not public but yes I was very happy to see how well LuaJIT with Nginx peformed for this problem set. I developed several solutions in C, C++, Java, Java+Zing, LuaJIT and Go. The Nginx/LuaJIT (openresty to be exact) solution had a great ratio of "approachable code" to "performance" factor. I was able to get it built and transfer its use to several other teams without them having to know C and still be able to make changes effectively.


Not sure if it's related, but LuaJIT can remove allocations all-together in a lot of cases. This[0] talks about how it works some.

[0]: http://wiki.luajit.org/Allocation-Sinking-Optimization


Most JITs do that.

Static compilation can do it to some degree as well, but in most mutation-happy languages (Go included) it cannot prove the allocation does not escape frequently enough to matter.


Not really. Most do escape analysis/SROA.

Allocation sinking is much more general. It works even if the allocation escapes (the allocation is sunk to the point where it escapes).

Additionally, all allocations can be sunk, not just stuff like the point class used in the example on that page. Growing dynamic buffers, string concatenation, etc, are all sinkable.

My understanding is that it's fairly tricky to implement (requires special consideration in runtime design) and so is not very widely used. Last I checked, the Dart compiler is the only other place I've heard of it being used.

FWIW its not really a thing Go would need anyway, given that you actually have control over your allocations.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: