Remix.run Logo
pengaru 5 days ago

I too knew someone in HFT ages ago that spoke of using java even in the hot path. He told me they disabled GC altogether in combination with not generating garbage in the hot path, with large enough machines to not OOM before markets closed for the day.

From what I saw poking at the development trading boxes they over-provisioned both cpu ghz and ram to a ridiculous level. The machines looked nearly idle at their busiest.

renewiltord 5 days ago | parent | next [-]

Disabling GC is wildly inefficient without making sure you don't have garbage because allocation will slow down the application to human scale. The magic is more in the no-allocation code than in the disable GC side. It is very annoying in Java because any non-primitive is boxed type. Object pools etc. Problem is it's easy to start in Java, but then you hit a wall. JNI has huge overhead. Exasperating. But hard to argue, sometimes if you don't start in Java you never get the problem because you never manage to bootstrap.

sshine 5 days ago | parent | prev | next [-]

I worked with low-latency trading with C# in the hot path; they had started with C++ and eventually migrated to C# and just kept tight control of allocations.

Later they’d go back to using C++ for training deep neural nets.

pjmlp 4 days ago | parent [-]

To avoid going back to C++, is exactly the reason why modern .NET has native support for tensors and various SIMD flavours.

perihelions 5 days ago | parent | prev | next [-]

> "large enough machines to not OOM before markets closed for the day"

Reminded of that missile defense system that was designed to be software-reset once a day, except the design assumptions changed (a war started) and it was ordered to be left running nonstop, as an emergency measure; after being left on for a week, failed, causing a large number of deaths. That one had some kind of integrator that accumulated floating-point roundoff over time.

peterfirefly 5 days ago | parent | next [-]

https://en.wikipedia.org/wiki/MIM-104_Patriot#Failure_at_Dha...

scottlamb 5 days ago | parent [-]

I interpret that write-up to mean the daily reboot was a temporary user-suggested workaround for a bug discovered in the field, rather than something in the product specs from the beginning. And it makes more sense to me that no one realized the errors would accumulate or thought to test long operation in general than it would for them to have explicitly said it wasn't important.

wrs 5 days ago | parent [-]

Kind of like nobody thought to see what happened if Windows 95 managed to stay up for over 49.7 days [0], only deadlier.

[0] https://www.cnet.com/culture/windows-may-crash-after-49-7-da...

0xffany 5 days ago | parent | prev | next [-]

Also on the topic of missiles, it reminded me of Raymond Chen's classic Null Garbage Collector

https://devblogs.microsoft.com/oldnewthing/20180228-00/?p=98...

mohaba 5 days ago | parent | prev | next [-]

Patriot missile range gate. I remember covering that in a numerical analysis class.

scottlamb 5 days ago | parent | prev [-]

> Reminded of that missile defense system that was designed to be software-reset once a day, except the design assumptions changed (a war started) and it was ordered to be left running nonstop, as an emergency measure

I'm sure you've simplified the story, but it seems like a bit of process failure for a missile defense system to assume peacetime. There's writing software that implements the requirements, and then there's making sure the requirements are right both up front and when you really rely on them in a critical way.

anonymousDan 5 days ago | parent | prev | next [-]

Yeah it always felt like they were jumping through hoops to basically write C code through Java. I expect some of this might shift to Rust..

kccqzy 5 days ago | parent [-]

Well you do get guaranteed memory safety.

saati 5 days ago | parent [-]

If they were mucking around with asm and custom jit those memory safety guarantees are gone.

potato3732842 5 days ago | parent | prev [-]

It's a vicious cycle between provisioning more server and devs figuring out how to get more speed by using the resources for pre-computation.