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

A stop-the-world GC for HFT doesn't sound like it would work all the well…


Many HFT firms use C# or Java. Quite a few matching engines are written in those languages as well.

The trick is to remember that garbage collection is not some sort of werewolf that wakes up and decides to mess with your stuff whenever it feels like it; it (can) happen only at certain, documented points. So you have to write your code in such a way that it does not do memory allocations in the critical path (which you would not be doing in C++ anyway, for a similar reason; malloc/free is expensive).

Generally if you're doing HFT your critical path is not going to being doing much anyway. A few reads, comparisons, maybe some trivial arithmetic and that should be it.


For what is worth, at least in London, all the HFT firms I have worked with or interviewed for use C++. As I'm a C++ programmer there is bias of course, so my sample is probably not representative. Still I suspect that those that use anything other than C++ are a small minority.




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

Search: