News for hackers. Stuff that matters.
Re:Java is better than C++ for high speed trading systems by Rebelgecko on Thursday November 26, 2020 @03:44PM (#25223390)
One interesting approach I heard about for doing garbage collection in finance is to get computers with a shitload of RAM and just turn off GC. At the end of the trading day you can reclaim memory by killing the process. Not sure how common that strategy is.
Re:Java is better than C++ for high speed trading systems by lmilcin on Thursday November 26, 2020 @07:24PM (#25224525)
That is exactly what I did. It was much less elegant and performant, though, than my initial solution with Common Lisp and C which basically allocated buffers in memory and mapped them with huge pages so that memory access don't ever require switch to kernel for mapping.

We also had custom Intel CPUs that are auctioned individually. And cutthrough switches that stream the IP packet immediately when they receive the IP header, before they receive the payload. I have calculated that if the message from exchange was a beam of light it would be delayed by less than a meter.

Re:Java is better than C++ for high speed trading systems by KMag on Friday November 27, 2020 @02:23AM (#25226268)
> would be delayed by less than a meter

That's just latency to your NIC, right? 1 meter ~ 3 ns ~ 9 CPU cycles at 3 GHz, less than the integer pipeline depth last I checked.

Re:Java is better than C++ for high speed trading systems by lmilcin on Friday November 27, 2020 @12:17PM (#25230513)
Latency through switch (ie. how much the switch added compared to if the signal traveled unimpeded in vacuum).

Decade ago.

Re:Java is better than C++ for high speed trading systems by dralley on Thursday November 26, 2020 @11:09PM (#25225479)
If that's your memory management strategy, then what do you actually gain by using Java?

May as well just use C and never free your memory. Lots of memory management issues go away if you never free memory.

Re:Java is better than C++ for high speed trading systems by peter_lawrey on Monday November 30, 2020 @06:31AM (#25252744)
Not all your services/code needs to have the lowest latencies so you can have a team which just needs to be able to translate the business requirements and a couple of people to optimise the critical code.
Re:Java is better than C++ for high speed trading systems by peter_lawrey on Monday November 30, 2020 @06:29AM (#25252732)
If you have multiple processes each with 24 GB of Eden space and you can produce 1 GB/hour of garbage in each service and still only GC once a day.
Re:Java is better than C++ for high speed trading systems by gbronner on Thursday November 26, 2020 @03:45PM (#25223399)
It works until it doesn't and you lose a ton of money