News for hackers. Stuff that matters.
Re:Java is very fast, if you don’t create many objects by Karellen on Monday September 12, 2022 @09:30AM (#32809918)
Even so, I wonder what advantages Java has, that makes using it in that environment so overwhelmingly compelling over other languages. Enough that it overcomes the fact that you have to write very non-idiomatic Java if you don't want to incur unacceptable performance costs.

It would be interesting to see what other languages were considered for the use case, and which cost/benefit considerations made Java come out on top.

Re:Java is very fast, if you don’t create many objects by StevePerkins on Monday September 12, 2022 @09:53AM (#32810249)
It's not so much the language as it is the virtual machine / runtime environment. The JVM is one of the most solid and heavily invested systems in the history of business software.

Notable companies who started off with PHP or Python or what have you, reached a stage in their growth where they had to either migrate, or else write their own in-house compilers to fork those languages and make them scalable. No one's ever had the need to do this with Java (although different vendors do produce their own tweaked builds in order to compete in the support space).

People generally assume that a virtual machine is a disadvantage over AOT compilation. And for the "To Do List" apps that so many students and hobbyists on these forums are writing, they are correct. But JIT compilation is vastly superior for long-running server side business processes. Which is the niche that Java owns (facing some competition from .NET, which works in the same manner). It's not sexy or beginner-friendly, so the level of discussion that it gets here is disproportionately low.

Re:Java is very fast, if you don’t create many objects by dec0dedab0de on Monday September 12, 2022 @10:14AM (#32810608)
JIT compilation is vastly superior for long-running server side business processes.

How is that possible? Assuming all things are equal AOT should always be better. The advantage of a virtual machine is being able to distribute the same files to different processors and operating systems. The advantage of a JIT is that it makes your virtual machine faster.... oh how I wish Python would have an official JIT, sigh.

But back to my question, if a JIT compiler takes bytecode and converts it to native code at runtime, and an AOT compiler takes source code and converts it to native code before being distributed, then how could JIT be faster? Is it that many people use AOT compilers in a generalized way instead of taking advantage of hardware specific optimizations? Or is the Java JIT compiler just so good at optimizing java byte code that it doesn't matter if it's compiled ahead of time or not?

Edit: I got too many answers, but thank you all. I didn't consider the extra optimizations possible with runtime data. Please keep replying if you think of other reasons.

Re:Java is very fast, if you don’t create many objects by blandflakes on Monday September 12, 2022 @10:40AM (#32811038)
Profile-guided optimization is considered pretty effective: https://en.wikipedia.org/wiki/Profile-guided_optimization

One example of an optimization that cannot be performed AOT is anything that can be done in response to "noticing" that every time you get a List, you actually have an ArrayList. AOT can't make the assumption, but a JIT can start doing things like specializing/inlining code the implementation in question.

Re:Java is very fast, if you don’t create many objects by im3w1l on Monday September 12, 2022 @04:04PM (#32816108)
Let's consider the context here. HFT for advanced programmers. A sufficiently smart programmer working on the hot path of some HFT trading program in an AOT language can change the parameter type to ArrayList.
Re:Java is very fast, if you don’t create many objects by nostrademons on Monday September 12, 2022 @05:26PM (#32817234)
You can't if the method is in the standard library, or really any third-party code you don't control.

That's one of the biggest advantages of profile-guided optimization that works at the bytecode/IR level. It can recognize that generic libraries are only ever called with a single concrete type, and then specialize them to that type, and then inline the data representations of the concrete data types you actually pass, and then inline all the accessors that access that data.

To do that AOT you need to rewrite the library, which usually defeats the purpose of having libraries in the first place.

Re:Java is very fast, if you don’t create many objects by hansvm on Wednesday September 14, 2022 @03:15AM (#32834191)
> need to rewrite the library

Or as one other possible instance of the design space you use the approach of cpp templates or any of Zig's comptime features -- when linking against a library you explicitly instantiate code corresponding to the things you know at compile time, apply optimizations, and throw away anything that's unused. Recognizing that generic libraries are only called with a single concrete type is child's play in those contexts.

Re:Java is very fast, if you don’t create many objects by blandflakes on Wednesday September 14, 2022 @09:09AM (#32836637)
> Recognizing that generic libraries are only called with a single concrete type is child's play in those contexts.

It's pretty trivial to prove this wrong. Return a different concrete type based on a config value that is loaded at startup. AOT can't save you here. We can keep moving goalposts but it shouldn't stretch the imagination that a program's runtime characteristics can't be exhaustively predicted at compiletime.

This is sort of like claiming that branch prediction isn't useful because can't you just throw away what's unused? No, obviously not, so if the branch exists, runtime analysis can find out which one is more likely to be called over time (and generics are just a branch at the type level).

Re:Java is very fast, if you don’t create many objects by hansvm on Wednesday September 14, 2022 @08:51PM (#32845592)
The person I was responding to said that AOT was a non-starter because the tech I mentioned doesn't exist, and that itself was in the context of a domain where you often wouldn't want the perf hit of even having a poor program binary layout and thus probably wouldn't want such things to be config options anyway.

In any event, I was just saying that AOT can definitely cross library boundaries, not anything near as strong as what you seem to be arguing against (it seems you believe I'm asserting something like AOT being superior to JIT in all cases).

Re:Java is very fast, if you don’t create many objects by jfengel on Monday September 12, 2022 @04:18PM (#32816314)
Sure. There's nothing Java can do that can't be done by hand.

The question is, how much effort are you going to put into the profiling to determine that that's an optimization worth making? The larger the program, the more difficult such optimizations are to find -- the example given here was a trivial one.

You could do all of this by writing machine code, or constructing a programmable logic array for it. But would you actually get more trading done that way, or would be get more profit turning your programmers onto other tasks rather than one that can be handled by a machine?

Re:Java is very fast, if you don’t create many objects by Someone on Monday September 12, 2022 @05:08PM (#32816998)
> Sure. There's nothing Java can do that can't be done by hand.

in practice there is. For example, the JVM can inline virtual calls to code that was loaded at runtime (even if that’s third party code for which you don’t have the source code).

To do that by hand, you more or less would have to write something like the JVM yourself.

Re:Java is very fast, if you don’t create many objects by blandflakes on Tuesday September 13, 2022 @10:37AM (#32824827)
Sure, it's possible to do it by hand, but it's not possible for the AOT to do it for you, and this then violates the parent's "all things considered equal" claim.

There are certainly going to be tradeoffs that runtime analysis can make that AOT cannot make, even if the example I wrote is possible to fix at compiletime.

Re:Java is very fast, if you don’t create many objects by sudarshnachakra on Monday September 12, 2022 @10:27AM (#32810819)
> How is that possible? Assuming all things are equal AOT should always be better.

The primary thing here is that the hotter the code path the more optimized your code will be using a JIT (albeit compiled with a compiler which is slower) which is impossible with AOT (since we have a static binary compiled with -O2 or -O3 and that's it) also Java can take away the virtual dispatch if it finds a single implementation of interface or single concrete class of an abstract class which is not possible with c++ (where-in we'll always go thru the vtable which almost always resolves to a cache miss). So c++ gives you the control to choose if you want to pay the cost and if you want to pay the cost you always pay for it, but in java the runtime can be smart about it.

Essentially it boils down to runtime vs compile time optimizations - runtime definitely has a richer set of profiles & patterns to make a decision and hence can be faster by quite a bit.

Re:Java is very fast, if you don’t create many objects by ehvatum on Monday September 12, 2022 @12:11PM (#32812467)
> Java can take away the virtual dispatch if it finds a single implementation of interface or single concrete class of an abstract class which is not possible with c++ (where-in we'll always go thru the vtable which almost always resolves to a cache miss)

C++ LTO makes devirtualization practical to the point that your browser is benefitting from it right now: https://news.ycombinator.com/item?id=17504370

Re:Java is very fast, if you don’t create many objects by Someone on Monday September 12, 2022 @05:18PM (#32817135)
> Java can take away the virtual dispatch if it finds a single implementation of interface or single concrete class of an abstract class

It can even do that if there are multiple implementations, by adding checks to detect when it is necessary to recompile the code with looser assumptions, or by keeping around multiple versions of the compiled code.

It needs the ability to recompile code as assumptions are violated anyways, as “there’s only one implementation of this interface” can change when new JARs are loaded.

Re:Java is very fast, if you don’t create many objects by mping on Monday September 12, 2022 @10:23AM (#32810757)
Mostly due to profiling, the JIT gets informed on actual program execution.

I wouldn't word it as vastly superior, because if you have a JIT you're probably doing some kind of tradeoff (most of the times, memory usage?), but the JIT can optimize based on the runtime profile, where an AOT't program cannot.

Re:Java is very fast, if you don’t create many objects by kjeetgill on Monday September 12, 2022 @11:14AM (#32811586)
I know you're getting bombarded with a dozen answers but I don't think anyone's also mentioned speculative optimization/deoptimization. Jit can and often does assume things that can't be proven like a specific call site can be inlined through a virtual call because in practice it's always the same hard type. It can back out the optimization later if that proves to be untrue. Or if a function is always called with the same variable because it was read from a config: it can assume that it won't change.
Re:Java is very fast, if you don’t create many objects by pron on Saturday September 17, 2022 @12:29PM (#32878788)
> how could JIT be faster?

1. AOT compilers have less information about the program than JITs (they only see the program as code; JITs see the code and the current execution profile)

2. AOT compilers can only make optimisations that they can prove don't change semantics, while JITs can be more aggressive, making optimisations that are speculative, deoptimising if wrong.

Re:Java is very fast, if you don’t create many objects by ElevenLathe on Monday September 12, 2022 @10:25AM (#32810787)
A JIT can see the actual values that occur in hot loops, among other things, which aren't accessible at compile time but are at runtime. There is simply more information available to a JIT.
Re:Java is very fast, if you don’t create many objects by kaba0 on Monday September 12, 2022 @11:21AM (#32811713)
A JIT compiler can elide a virtual method to a simple static call based on how many implementing classes are loaded at runtime, or can remove conditional branches from code (e.g. think of a setting whose boolean value is checked in a hot loop (for example something graphics related) - a JIT compiler will remove the conditional based on the setting used).

Fun fact, the linux kernel actually has something similar with self-modifying code, that will remove a conditional at runtime.

Re:Java is very fast, if you don’t create many objects by vips7L on Monday September 12, 2022 @10:24AM (#32810766)
The JIT compiler has live runtime data on how the program is actually used and it optimizes around this instead of what the source code says. For instance, the JIT compiler can see that a function has never been passed a null object and optimize out null checks and other branches that are never taken at runtime. An AOT compiler doesn't have this information unless its provided PGO data at compile time.
Re:Java is very fast, if you don’t create many objects by hbrn on Monday September 12, 2022 @11:38AM (#32811955)
Nitpicking here.

> JIT compiler can see that a function has never been passed a null object

It cannot. It can only see that function has never been passed a null object so far.

And the cost of such optimization might be that edge cases are way slower than anticipated. But what if those edge cases are actually the only thing that provide value for your business?

Imagine you're building a monitoring system that alerts very rarely, but reaction time is really critical for you. Do you really want to JIT compiler to optimize the alerting branch out because it hasn't seen any alerts yet?

My bet is that JIT compiler rarely does those optimizations by default, because it cannot know which branches in your code contain business value. I don't need my code to be twice as fast on average but twice as slow on critical branches.

Now, what would be great if profiler would make suggestions about how to modify your code for performance based on usage. But those should be approved and commented by humans, because humans know whether those are valuable optimizations or a fad.

Re:Java is very fast, if you don’t create many objects by vips7L on Monday September 12, 2022 @12:11PM (#32812469)
> so far

This is truly a nit pick.

> Imagine you're building a monitoring system that alerts very rarely, but reaction time is really critical for you. Do you really want to JIT compiler to optimize the alerting branch out because it hasn't seen any alerts yet?

Yes I do, because once the constraints are invalidated the the runtime system will instruct the JIT to recompile the code with the now uncommon branch [0].

[0] https://shipilev.net/jvm/anatomy-quarks/29-uncommon-traps/

Re:Java is very fast, if you don’t create many objects by garblegarble on Monday September 12, 2022 @12:44PM (#32812937)
>> JIT compiler can see that a function has never been passed a null object

>>... so far.

>This is truly a nit pick.

It's not even a nitpick, it's just wrong - your original statement is true: you said "has never been". The "so far" reply you received mistakenly implies you said "will never be" (given that HotSpot will deoptimise+reoptimise if its assumptions are invalidated)

That said, the remainder of their point I think is reasonable in the extremely specific (I think to the point of being unrealistic, given this seems like a hand-optimised assembly level of perf importance they have alluded to) scenario they mentioned - the JIT optimiser can't know that the user wants to optimise an extremely rare branch for performance to the point where the overwhelmingly common case should be degraded.

Another useful jumping off point to explore for HotSpot's performance techniques is [1]

1: https://wiki.openjdk.org/display/HotSpot/PerformanceTechniqu...

Re:Java is very fast, if you don’t create many objects by hbrn on Monday September 12, 2022 @01:20PM (#32813511)
Can you show me how exactly does the optimization/deoptimization of unused branch look like? You need detect that you got into an unused branch and that requires... a branch!

In order to be able to optimize presumably dead branches you need a primitive that:

1. Can detect entering "dead" branches

2. Is faster than branch.

I'm not saying JIT optimizations are not possible, JIT compiler can totally choose to inline function call based on frequency or loop length. It can make "better" time/space complexity decisions (though "better" is still going to be controversial).

But optimizing branches because they were not called in runtime seems like common a myth. Like previous commenter who confused startup optimization with code optimization.

Re:Java is very fast, if you don’t create many objects by lkorinth on Monday September 12, 2022 @02:47PM (#32814950)
1) You catch the SEGV signal you get when failing to read the address, then it is complicated, but it is similar to the mechanism used to reach safe points (also does not use jumps).

2) If there are no nulls, it is faster not to do a branch.

https://shipilev.net/jvm/anatomy-quarks/25-implicit-null-che...

Re:Java is very fast, if you don’t create many objects by hbrn on Monday September 12, 2022 @03:17PM (#32815375)
> Java specification says that NullPointerException would be thrown when we access the null object fields. Does this mean the JVM has to always employ runtime checks for nullity?

Once again, we're talking about how JIT can be faster than AOT, not how to reduce JIT overhead. Those are two different types of optimization. You will never be faster than AOT just by reducing JIT overhead. Both links that were provided talk about JIT overhead alone.

This one talks about internal JVM optimizations. Not about optimizations JIT is capable of doing for your code.

What exactly are we even comparing when talking about NullPointerException? To my knowledge, most AOT-compiled languages don't even have NPE (not in Java sense at least). It's apples to oranges comparison.

Re:Java is very fast, if you don’t create many objects by lkorinth on Monday September 12, 2022 @07:19PM (#32818633)
If we have the code "if (x != null) { x.foo = 42; }", then it can rewritten as x.foo = 42 (with some extra magic in the runtime). If x is not null it will be faster if the cost of a branch is higher than zero. If x is null, the (slow) trick with SEGV can be used.

The trick of catching the SEGV can also be used by an AOT compiler (https://llvm.org/docs/FaultMaps.html), but the AOT compiler would need profiling data to do this optimization that is more expensive to do if the variable x happens to be null often. Even if you have profile data for your application, and that profile data will correspond to your application profile of this particular run (on average), you can not handle the case when x != null for five hours and then is set to null for five hours. If you use an AOT compiler you would have exponential blow-up of code generations for combinations of variables that can be null (if you would try to compile all combinations), and you would basically reinvent a JIT compiler --- badly.

Theoretically, a JIT can do anything an AOT can do, but the reverse is not true.

The article is talking about optimizations the JIT is capable of doing for your code. It is well written, and although it is talking about code throwing a NullPointerException, I think you can see that the same optimization can be done for my example at the top (that is applicable to c++ as well). So my comparison is not apples to oranges.

But your observation that most compiled languages do not have NullPointerExceptions is interesting. It could very much be because that it is too expensive with an AOT, have you thought about that?

Re:Java is very fast, if you don’t create many objects by kaba0 on Tuesday September 13, 2022 @01:59AM (#32821080)
Also, in an AOT-way you couldn’t really play the same SEGFAULT trick multiple times without some expensive tracking of where did it come from, where to return to, etc, at which point you are doing borderline JIT compiler with precached method bodies.
Re:Java is very fast, if you don’t create many objects by kjeetgill on Monday September 12, 2022 @06:40PM (#32818137)
Well I guess the point is that with JIT you can do a lot of tricks based on the fact that a function always gets passed a null (or anything relatively constant) in practice even if that wouldn't be statically probable.

If that assumption gets violated a JIT can deopt and adjust later. In AOT you can only make the assumptions based on what the code can statically tell you.

Re:Java is very fast, if you don’t create many objects by hbrn on Monday September 12, 2022 @07:18PM (#32818615)
Feels like we're going in circles. I guess that's what you get for nitpicking :)

JIT can indeed do a lot of tricks to reduce JIT overhead. But you can't present that as a benefit of JIT over AOT: AOT doesn't have JIT overhead at all.

JIT can definitely trade space for time. I bet that JIT will inline/memoize certain calls based on call frequency.

The only thing I'm arguing against is that low call frequency (like zero branch executions) somehow provides room for optimization compared to AOT. The only optimizations you can do in this case are optimizations for JIT overhead itself.

Anything beyond that is simply not possible: you can't eliminate a branch and detect the fact that you were supposed to enter eliminated branch at the same time: the simplest mechanism that allows you to do that is branching!

Re:Java is very fast, if you don’t create many objects by kaba0 on Monday September 12, 2022 @02:39PM (#32814825)
One trick that OpenJDK uses is optimization of null checks. Since in Java memory has to be initialized, null pointers will have the value 0. If a given function using a null check gets called many times, and all these times it was called with a non-null object the JVM can compile the branch totally away. If the function is finally called with ‘null’ the compiled code will try to load the memory at address zero, causing the TLB to trigger and the OS to send a segfault. This can be handled safely by the JVM which will interpret it in accordance with the above and will deoptimize the code (with all possible side effects reverted) and either run it in interpreted mode or an optimized mode that does contain the null check “properly”.
Re:Java is very fast, if you don’t create many objects by Karellen on Monday September 12, 2022 @03:59PM (#32816030)
How will the runtime system know to invalidate and recompile the code, if the alert check isn't being done on every call?

At some level, the check for the alert has to be done on every call. If it isn't being done, the one time there should be an alert it will be missed. If it is being done, where is it being done if not in the optimised JITted code, and how is that code even more optimised than the JITted version would be? Why not just put that optimisation in the JITted code?

Re:Java is very fast, if you don’t create many objects by kjeetgill on Monday September 12, 2022 @06:36PM (#32818070)
The terms you'll want to read up on are JIT speculation and deoptimisation. There's a whole range of things that can be done like trapping the null derefrence instead of an explicit check, once hot code is inlined the check could be lifted out several call frames outside of loops. Then you can ignore the check later.

All sortsa stuff can happen.

Re:Java is very fast, if you don’t create many objects by hbrn on Monday September 12, 2022 @12:36PM (#32812825)
We're talking about optimizations that JIT can do compared to AOT.

The link you shared talks about skipping compilation for certain branches to speed up the JIT compilation. Such optimization makes startup faster, but it doesn't make code execution faster. AOT compiled languages don't have slow startup problem in the first place.

It's like saying paper books are worse than e-ink readers because you cannot charge paper books.

Re:Java is very fast, if you don’t create many objects by kaba0 on Monday September 12, 2022 @01:13PM (#32813372)
Eliding a branch makes not only compilation faster, but the resulting code as well. That’s how for example some logging statements become zero-cost when the debug level is set lower than their corresponding one. JIT compiled languages don’t care too deeply about startup, they shine with longer runtimes.
Re:Java is very fast, if you don’t create many objects by hbrn on Monday September 12, 2022 @01:40PM (#32813926)
Are you sure you're not confusing zero-cost with almost zero-cost? Even zerolog talks about negligible costs after most aggressive optimizations, not zero: https://github.com/obsidiandynamics/zerolog

If you're just using constants in your code to set logging level, AOT compilation can do exactly the same optimizations.

Re:Java is very fast, if you don’t create many objects by blackoil on Monday September 12, 2022 @09:53PM (#32819870)
AOT would require recompilation and deployment. JIT can do it for the same code with final params.

When the log level is not final, branch prediction Will ensure JIT code is faster.

Re:Java is very fast, if you don’t create many objects by pron on Saturday September 17, 2022 @12:31PM (#32878802)
JIT compilers do exactly that. Not only do they have more information, they are also allowed to -- and very frequently do -- perform speculative optimisations. If proven wrong, they incur "deoptimisations" and then recompile with more information.
Re:Java is very fast, if you don’t create many objects by alserio on Monday September 12, 2022 @02:43PM (#32814892)
I don't believe this is right. The optimization as described does not preserve the correct program behavior unless you have a guard to do the null check anyway to fallback to the slow path

edit: just read kaba0 answer below and in fact it's possible via tlb miss, really cool

Re:Java is very fast, if you don’t create many objects by peter_lawrey on Wednesday September 14, 2022 @11:47PM (#32846744)
Something not generally mentioned is that Java can inline what would be virtual methods in C++, it can also remove them as behaviour changes or code is unloaded.
Re:Java is very fast, if you don’t create many objects by chmod775 on Monday September 12, 2022 @09:37AM (#32810027)
> Even so, I wonder what advantages Java has, that makes using it in that environment so overwhelmingly compelling over other languages.

Presumably not the whole thing needs to be that fast, only the part that actually handles the individual events. Java has the advantage of being an industry standard, or at least being very common in the financial sector.

So you can work in a single language while only having to write some un-idiomatic Java in places where performance is critical.

Re:Java is very fast, if you don’t create many objects by kaba0 on Monday September 12, 2022 @09:58AM (#32810338)
It is pretty much unparalleled in terms of the product of ecosystem size and performance. The other two languages in the top 3 are javascript and python, both have serious deficits regarding parallelism. As seen, it is a pretty strong contender in performance alone as well, with perhaps the best observability, and it has a well-defined execution semantics, even regarding erroneous execution — while any sort of memory error in a lower level language may silently corrupt the heap after which no assumption can hold regarding program state.

Also, primitive-only java programming is probably no worse than similarly low-level C/C++/etc.

Re:Java is very fast, if you don’t create many objects by nesarkvechnep on Monday September 12, 2022 @03:23PM (#32815447)
Java’s observability is a joke when compared to Erlang’s.
Re:Java is very fast, if you don’t create many objects by kjeetgill on Monday September 12, 2022 @06:45PM (#32818204)
I'm not that familiar with it, I'd love to know more! I'd be curious what we could bring to Java land.
Re:Java is very fast, if you don’t create many objects by origin_path on Monday September 12, 2022 @05:11PM (#32817035)
Java in HFT is a mix of things.

Firstly: memory safety. You might not be allocating but you're benefiting from optimized bounds checks and type safety. If you're trading at HFT speeds then you need your program to throw an exception if something goes wrong, and not simply make a trade with a random bit of the heap sent to the exchange in the 'quantity' field. And you need it to be easily diagnosed when that happens, without taking your whole service offline.

Secondly: these programs do actually allocate sometimes. They just don't do it (much) in the hot path in prod. For instance they'll happily write normal Java code that runs at startup to load data files, and they'll happily write normal code on cold paths that aren't hit all that often. They may well do allocations in test mode for logging, test verification etc. Some HFT shops do even allocate in the hot paths but they just size the heap so it doesn't collect during the trading day, and then they run a GC once markets close.

Thirdly: HotSpot is a very easy way to get PGO which is normally considered to be a 10%-25% performance win. Getting it from C++ toolchains is possible, but hard, and Java has the advantage that if market conditions suddenly change and you start going down different codepaths it'll re-compile on the fly, whereas for C++ you'd have to wait for the next rebuild to re-establish an optimal hot path.

Fourthly: not allocating isn't actually all that weird or non-idiomatic. Quite a lot of apps use this "allocate up front, but not in the hot path" approach. Check out Mindustry, it's a game written in Java that hits a solid 60fps at minimum and can easily hit hundreds of fps. It's just silky smooth even on a non-gaming laptop. How? Doesn't allocate in the rendering loop. Object pooling is hardly radical, most apps with real time latency requirements do that even in C++.

Re:Java is very fast, if you don’t create many objects by kjeetgill on Monday September 12, 2022 @09:40AM (#32810077)
Unacceptable performance costs are pretty contextual though. Plenty of code becomes a unidiomatic if you have to avoid a malloc() or new at all costs for example.

HFT folks in any language tend to break idioms to wring every cycle they can out of a machine. I'd bet you'd be faster in well tuned C++ code, but why not asm then?

Re:Java is very fast, if you don’t create many objects by peter_lawrey on Wednesday September 14, 2022 @11:48PM (#32846747)
or FPGA
Re:Java is very fast, if you don’t create many objects by tstrimple on Monday September 12, 2022 @10:44AM (#32811106)
One factor I've run into is the cost of offshore development for non-Java technologies. It's so much more difficult to find .NET Core developers in India than a Java developer for example. Forget about Rust or Go. Many enterprise development operations view developers as fungible which I disagree with, but it's much easier to pretend they are fungible if you're using something like Java rather than Rust.
Re:Java is very fast, if you don’t create many objects by blackoil on Monday September 12, 2022 @09:58PM (#32819902)
I don't think HFT are hiring from body shops. Of you want the top layer, you'll find Go, Rust devs in India but they'll not be cheap.
Re:Java is very fast, if you don’t create many objects by speed_spread on Monday September 12, 2022 @05:40PM (#32817388)
> non-idiomatic Java

I'd contend that non-allocating superfast code in any language ends up looking kind of odd. High Frequency Trade programs have a lot in common with embedded microcontroller apps. Except they're also doing business transactions.

Re:Java is very fast, if you don’t create many objects by another2another on Thursday September 15, 2022 @07:48AM (#32850323)
>have to write very non-idiomatic Java if you don't want to incur unacceptable performance costs.

You would also, I guess have to choose any library dependencies very carefully as well. Or implement the functionality yourself, negating any advantage that might bring in speeding up development.