Live data from Hacker News

We chose Java for our high-frequency trading application

medium.com

231–240 of 287 posts

Re: We chose Java for our high-frequency trading application

#231

Earlier quoted context omitted.

If you add -XX:+AlwaysPreTouch to the JVM arguments, the JVM will pre-touch the entirety of the heap at startup time to avoid unpredictable page faults through the life of the application. I'd imagine other HFT companies may also pay for the Azul JVM which goes even further and comes with a kernel module that the JVM coordinates with for memory allocation. The kernel module pre-reserves x% of system memory at the tim…

Is the Azul JVM open source? I thought it was just the support which costed money. (I'm just not familiar enough with it)

There's two, Zing (pay for support) and Zulu (pay for access)

Re: We chose Java for our high-frequency trading application

#232

Does anyone know if C#/dotnet is used in HFT to any extent? I'd imagine proper support for user-defined unboxed types (structs) and non-hacky methods for manual memory management (unsafe) could give it major advantage over Java with much of the QoL improvements java has over C++.

I work in a company that uses C# for HFT.

However, we moved away from “pure C#” about 10 years ago, to use FPGAs, especially in the ultra low latency stuff.

A lot of strategies can still be profitable with C#, colo’ed servers and kernel bypass NICs.

Re: We chose Java for our high-frequency trading application

#233
post #63

I have a question: When i finished my theoretical Physics PhD, HFT was THE way out of academia for making money in my field. I didn't follow this path as it felt at the time a pretty evil thing to do. Does HFT provide any benefits for our society?

No, but there are many things that don't provide any net value that is even more prolific. All the sugary drinks that just give you health issues, the big monopolistic companies that replaced smaller decent-wage shops with big low-wage machines that suck the value out and doles it out at the top. If everything is designed to take value from one place and never give back, is that beneficial? Of course not. If you only…

> All the sugary drinks that just give you health issues (...) > Evil is everywhere, really.

i know, i live 10km from Nestlé HQ. and the banks in my country manage a significant part of the cash in this world.

> Our brains are not made to really understand these things well.

Agreed. I was recently reading several text saying that our brains are adapted to small hunter-gatherer communities of 300 ppl max.

> The easiest thing is to resign yourself to at least make you and your familys life easier.

Not now i know how the Earth System react, because a look at the latest IPCC projections doesn't make me want found a family.

> Which is acceptable enough.

Listening to some climatologists, there is a chance i see a world with less than a billion person from my own eyes. My brain cannot accept such a perspective acceptable (without actively fighting it at least).

Re: We chose Java for our high-frequency trading application

#234
post #63

I have a question: When i finished my theoretical Physics PhD, HFT was THE way out of academia for making money in my field. I didn't follow this path as it felt at the time a pretty evil thing to do. Does HFT provide any benefits for our society?

Some people argue that HFT provides liquidity for retail investors, but it's debatable whether that liquidity is real or not since it'll be gone during black swan events. At the same time HFT profit from uninformed/retail flow. So it's debatable wether the actual activity provides values. I'd say probably not. But there can be indirect value in working in HFT, just like there is with other demanding jobs. There's int…

I agree somehow, in academia we often create glitter (we call that "innovation") to make us feel useful for civilisation. In the end everyone just fight for her/his own ass.

But you know, i'm more willing to write application for Earth Sciences (like im doing now) and living a misery than transferring cash & stocks with obscure algorithms..

That might just be stupid, maybe you're correct, that's just a story i tell myself.

Re: We chose Java for our high-frequency trading application

#235
> dedicated sub-oceanic lines (Hibernian Express is a major provider), even microwave networks.

This statement as a definitive "this is how it works" makes me think the person who wrote this doesn't really work in anything at the intersection of networking and HFT.

Much of the serious HFT for transoceanic stuff at low bitrates, but very important signalling messages, moved to shortwave radio with giant-ass aimed yagi-uda antennas several years ago.

You can go out to some places not very far from the CME datacenter in Illinois and find big, suspicious shortwave band things aimed at Tokyo.

Re: We chose Java for our high-frequency trading application

#236

> dedicated sub-oceanic lines (Hibernian Express is a major provider), even microwave networks. This statement as a definitive "this is how it works" makes me think the person who wrote this doesn't really work in anything at the intersection of networking and HFT. Much of the serious HFT for transoceanic stuff at low bitrates, but very important signalling messages, moved to shortwave radio with giant-ass aimed yagi…

To add to this, I know for a fact some people who are really serious about Java + HFT, and they would never ever use a GC. I can’t believe how much this article talks about Zing and other GCs, while the de-facto standard way of doing this is to just always reuse all objects and never deallocate them.

I get a very real feeling that the people writing this article have no idea what they’re talking about.

Re: We chose Java for our high-frequency trading application

#237

I think I actually saw these folks present at JavaOne a couple years ago? Either that or there's more than one shop branding itself as "HFT" that uses Java. I worked in the industry and it's always a little funny to see who calls themselves HFTs vs quants. Basically, there's a bit of a spectrum of fast vs smart. In general it's hard to do incredibly smart stuff fast enough to compete in the "speed-critical" bucket of…

Agreed. A lot of this is all standard now - even when I wrote about it circa 2013 [1]

[1] https://queue.acm.org/detail.cfm?id=2536492

Re: We chose Java for our high-frequency trading application

#238

> dedicated sub-oceanic lines (Hibernian Express is a major provider), even microwave networks. This statement as a definitive "this is how it works" makes me think the person who wrote this doesn't really work in anything at the intersection of networking and HFT. Much of the serious HFT for transoceanic stuff at low bitrates, but very important signalling messages, moved to shortwave radio with giant-ass aimed yagi…

To add to this, I know for a fact some people who are really serious about Java + HFT, and they would never ever use a GC. I can’t believe how much this article talks about Zing and other GCs, while the de-facto standard way of doing this is to just always reuse all objects and never deallocate them. I get a very real feeling that the people writing this article have no idea what they’re talking about.

How do you do that? Even when your code has no memory allocations sockets still leak memory.

Re: We chose Java for our high-frequency trading application

#239

Earlier quoted context omitted.

I discovered something amazing when working with some people who were writing HFT software. Why do you need 1TB of RAM in these machines? Because when you're Java based, you want to avoid stop-the-world GC pauses. These trading systems only have to be up from 9:30AM-4:30PM EST, so they simply disable GC altogether! At the end of a trading day, restart the app or reboot the system.

Speaking from experience with JVM HFT applications (we used Scala). There are a lot of tricks though to not require 1TB. And allocation in general is a bad idea even if you don't collect because it scatters stuff all over memory and messes up cache locality. You really, really don't want to allocate in a performance sensitive jvm application if you can avoid it. It's the opposite of a lot of what I was told and taugh…

Ha, these are many of the same things one might do to make a chess engine fast on the JVM. This only strengthens my belief that the best computer science education you can get is studying chess programming.

Re: We chose Java for our high-frequency trading application

#240
post #154

Earlier quoted context omitted.

This was a great read, thanks for that! Never heard of The Daily WTF before.

Congratulations! https://xkcd.com/1053/

Of course there’s an XKCD for this! Ah, the wonders of the internet.

The article in question was written in 2008: I was 11 years old. I guess I now fall in to the category of “heard of it by the age of 30”.

Post reply on HN