5 ms·
Do you actually mean that I need an expensive, dedicated hardware accelerator to get Java's performance to match C++? Why not do as they actually did: use C++
by realo 11y ago
Do you actually mean that I need an expensive, dedicated hardware accelerator to get Java's performance to match C++?
Why not do as they actually did: use C++ ? Sounds simple enough... and much cheaper.
- egwor 11y agoA few things to consider: * it tends to be harder to write good C++ code than Java. For example we think that an average person can write better java code than C++ code because java is simpler to get going with. We also think that the average developer makes fewer mistakes in java than C++ (because C++ allows you to do 'crazy things!') * that means that you need (on average) a better developer for C++, and that tends to cost more * java tooling is exceptional (probably the best there is?) * making small changes and releasing is much quicker in Java; builds tend to be shorter in duration for example * once you have the framework for your system, the differentiator is then the business benefits delivered. If you can push small changes out very quickly you're getting rewards quicker and you can experiment more * once you get down to certain performance points, it becomes similar writing java code as writing C++ code, but the JVM is also doing various work that you can't control so much. That can then inhibit you. Other things: * Azul isn't just h/w development it's also now in kernel plugin form iirc * Have a look at Aeron (https://github.com/real-logic/Aeron https://github.com/real-logic/Aeron) and I think the C++ and Java versions are fairly similar performance and they're designed by super with decent (industry renowned) developers writing it * A lot of people write high performance code making extensive use of templates. That's a totally different way of programming than usual C++
- Retric 11y agoBoring C++ is often faster than boring Java code. It's safer to write hacky Java, but code reviews should not let hacky code in. C++ costs more, but that's often a non issue for a trading floor. Security is much simpler in the Java world, but also possible in boring C++ code. Making small changes is really more a question of your code than anything else IMO. There is a lot of crazy C++ and Java code out there. Now for basic CRUD apps Java is a clear win. For high preformance trading that's an open issue. But, IMO there are much better languages to use.
- Roboprog 11y agoWhat about a third way? I have not used the GNU version of Ada or Pascal, but you get C/++ style allocation choices (static, stack, heap) without all of the safeties turned off. Having bounds checks (with line number error reporting, rather than secondary, tertiary... damage followed by a core dump), and the use of non-null references (as well as pointers for the initial allocation from the heap) goes a long way towards eliminating much of the time wasting bullshit that C/++ brings into your life. C is good for portable assembler. Otherwise, I want something less wacky than C++ to be "effective" with at a medium low level, and something higher level than Java for most other apps.
- threeseed 11y agoWhere are you going to get a team of Ada/Pascal developers from ? And tools to support them ?
- Roboprog 11y agoAnd Enterprise Management has spoken! Ignoring the fantasy that I would get to use something higher level (than Java) for most work... Not everybody panics if they have to write code outside of Eclipse or Visual Studio. Once upon a time, there was an expectation that programmers knew, or could learn, more than one language. Sorry about the rude response, but I'm really sick of the dumbing down of everything for (counterproductive) business or "risk management" purposes. To paraphrase, "average performance" in this industry is pretty poor.
- loopbit 11y agoNo, in many cases the JVM performance will match and sometimes even outperform a C++ implementation in terms of performance and I've seen a few examples of that, although math-heavy operations is usually not one of them. In terms of size and memory usage, a C++ implementation will almost always win. The problem with Java is that it's not as deterministic in terms of performance as C++, so in areas where that is a must, it has to be taken into account. Even after saying that, the GC can, and indeed should, be tweaked and optimized. The JVM gives you more tweaking options and tools to optimize the garbage collection than any other platform I've worked with, but most developers don't know about them or don't care. In cases like the original comment mentioned, it may have been better to continue using the C++ implementation, or it might have been useful to spend a bit less in consultants and developers and a bit on Azul's Zing (and maybe a few people that understood the platform). It might have saved a lot in the long term and indeed there are plenty of algorithmic trading solutions written in Java.
- sievebrain 11y agoAzul isn't THAT expensive. These days it's just x86 software anyway. Financial trading firms are actually one of their top customers, if I understand correctly, and Oracle is developing features for low latency work partly driven by the demands of algorithmic trading shops.
- hga 11y agoOK, but it's more expensive that "free", and they didn't previously list their prices, but now I see at the excellent https://www.azul.com/products/zing/zinqfaq/ https://www.azul.com/products/zing/zinqfaq/ Zing is priced on a subscription basis per server.... The annualized subscription price for Zing per physical server ranges from $3500 (for several hundred servers) to $8000. Higher volumes and longer subscription terms will reduce the per-server price for Zing. Pricing for virtual servers is also available upon request. Since you're likely to be running it on a server with a hardware cost approximately the same or larger, next time I'll only use two dollar signs ($$) ^_^. And I've indeed heard it's popular with financial trading firms for the obvious reasons. Up to 1 TiB heap, no problem, and no 1,024 second pause which other collectors require for a full GC.
- pjmlp 11y agoC++ is just free, because you happen to have clang and gcc to choose from among a pool of otherwise commercial compilers. I remember when all C++ compilers worth using were commercial.