Hacker Newsnew | past | comments | ask | show | jobs | submit | grim_io's commentslogin

If only the people responsible for the tariffs, who miss no chance to (miss)quote Reagan, would take the time to listen to his actual words regarding tariffs https://www.youtube.com/watch?v=5t5QK03KXPc

Wouldn't Java always lose in terms of latency against a similarly optimized native code in, let's say, C(++)?

Not necessarily. Java can be insanely performant, far more than I ever gave it credit for in the first decade of its existence. There has been a ton of optimization and you can now saturate your links even if you do fairly heavy processing. I'm still not a fan of the language but performance issues seem to be 'mostly solved'.

"Saturating your links" is rarely the goal in HFT.

You want low deterministic latency with sharp tails.

If all you care about is throughput then deep pipelines + lots of threads will get you there at the cost of latency.


You can achieve optimized C/C++ speeds, you just can't program the same way you always have. Step 1, switch your data layout from Array of Structures to Structure of Arrays. Step 2, after initial startup switch to (near) zero object creation. It's a very different way to program Java.

You have to optimize your memory usage patterns to fit in CPU cache as much as possible which is something typical Java develops don't consider. I have a background in assembly and C.

I'd say it's slightly harder since there is a little bit of abstraction but most of the time the JIT will produce code as good as C compilers. It's also an niche that often considers any application running on a general purpose CPU to be slow. If you want industry leading speed you start building custom FPGAs.


As long as you tune the JVM right it can be faster. But its a big if with the tune, and you need to write performant code

Java has significant overhead, that most/every object is allocated on heap, synchronized and has extra overhead of memory and performance to be GC controlled. Its very hard/not possible to tune this part.

You program differently for this niche in any language. The hot path (number crunching) thread doesn't share objects with gateway (IO) threads. Passing data between them is off heap, you avoid object creation after warm up. There is no synchronization, even volatile is something you avoid.

> Passing data between them is off heap

how exactly you are passing data? You can pass some primitives without allocating them on heap. You can use some tiny subset of Java+standard library to write high performance code, but why would you do this instead of using Rust or C++?


In some places I'm using https://github.com/aeron-io/agrona

Strangely this is one of the areas where I want to use project panama so I might re-implement some of the ring buffers constructs.

You allocate off heap memory and dump data into it. With modern Java classes like Arena, MemoryLayout, and VarHandle it's honestly a lot like C structs.

I answered "why" in another post in this thread.


> You allocate off heap memory and dump data into it. With modern Java classes like Arena, MemoryLayout, and VarHandle it's honestly a lot like C structs.

my opinion is that no, it is not, declaring and using C struct is 20x times more transparent, cost efficient and predictable. And that's we talking about C raw stucts, which has lots of additional ergonomics/safety/expression improvements in both c++ and rust on top of it.


Depends. Many reasons, but one is that Java has a much richer set of 3rd party libraries to do things versus rolling your own. And often (not always) third party libraries that have been extensively optimized, real world proven, etc.

Then things like the jit, by default, doing run time profiling and adaptation.


Java has huge ecosystem in enterprise dev, but very unlikely it has ecosystem edge in high performance/real time compute.

There are actually cases when Java (the HotSpot JVM) runs faster than the same logic written in C/C++ because the JVM is doing dynamic analysis and selective JIT compilation to machine code.

I personally know of an HFT firm that used Java approximately a decade ago. My guess would be they're still using it today given Java performance has only improved since then.

it doesn't mean Java is optimal or close to optimal choice. Amount of extra effort they do to achieve goals could be significant.

Optimal in what sense? In the java shops I've worked at it's usually viewed as a pretty optimal situation to have everything in one language. This makes code reuse, packaging, deployment, etc much simpler.

In terms of speed, memory usage, runtime characteristics... sure there are better options. But if java is good enough, or can be made good enough by writing the code correctly, why add another toolchain?


> But if java is good enough, or can be made good enough by writing the code correctly,

"writing code correctly" here means stripping 95% of lang capabilities, and writing in some other language which looks like C without structs (because they will be heap allocated with cross thread synchronization and GC overhead) and standard lib.

Its good enough for some tiny algo, but not good enough for anything serious.


It's good enough for the folks who choose to do it that way. Many of them do things that are quite "serious"... Databases, kafka, the lmax disruptor, and reams of performance critical proprietary code have been and continue to be written in java. It's not low effort, you have to be careful, get intimate with the garbage collector, and spend a lot of time profiling. It's a totally reasonable choice to make if your team has that expertise, you're already a java shop, etc. I no longer make the choice to use java for new code. I prefer rust. But neither choice is correct or incorrect.

> Databases, kafka, the lmax disruptor, and reams of performance critical proprietary code have been and continue to be written in java.

those have low bar of performance, also they mostly became popular because of investments from Java hype, and rust didn't exist or had weak ecosystem at that time.


Jazzband have done the world a lot of good. They deserve better.

For a brief moment, they were the top performers in benchmarks with the release of Grok 4.

Then they suddenly fired tons of people. Elon does not understand the market and the competition. You can't run a frontier AI lab like any old VC slop company.


Accroding to https://artificialanalysis.ai, it's around Gemini Flash 3, or some of the Chinese open weight models, like GLM 5.

For all the money burned, I am not impressed. Why would I use Mecha Hitler for almost double the cost of Gemini Flash 3?


Try being a translator today. You can provide as much value as you want, you won't get a job anymore.

The demand for authorised translators (approved in country X to correctly translate into country X’s native language from a particular language) has been steadily growing with globalisation and international trade. Contracts, court documents, financial records, medical records, birth and death certificates, technical reports: all of these must be translated and stamped by someone with the authority to do so, someone the government has confirmed to be competent.

The professional guilds are sounding the alarms, because there aren’t enough translators qualifying.


That's just factually untrue though. And there are high profile examples I would expect any well read person to know.

And we're at the point where you have to essentially choose the factually wrong point of view so there's no worth in even listing the counter examples.


Absolute madman :)

Giving an agent access to AWS is effectively giving it your credit card.

At the max, I would give it ssh access to a Hetzner VM with its own user, capable of running rootles podman containers.


I am using an AWS Organization managed sub-account, so it's all pretty self-contained to that one account, and I can easily enough terminate that single sub-account.

There's infamously no way to set a max bill amount for an account in AWS, so it indeed has unlimited spending, but I'm okay with a couple hundred bucks a month.

> Hetzner VM with its own user, capable of running rootles podman containers

Why not give it root on the full VM, and not use the VM for anything else? Giving it a user, and presumably also running your own stuff as a different user, sounds like a very weak security boundary to me compared to giving it a dedicated machine.

If you're not doing multi-tenancy, there's no reason to not give it root, and if you are doing multi-tenancy, then your security boundary is worse than mine is, so you can't call me a madman for it.


Not at all. AWS IAM policy is a complex maze, but incredibly powerful. It solves this exact problem very well.

Do you honestly believe that they made the effort of setting the appropriate roles and policies, though?

you tell your clanker to do it obviously

I wish I could fuck up this much this often and still get richer every day.

Say what you will about Zuck, he's made investors a trillion dollars. If they cared about his occasionally being wrong and losing a few billion here or there, it's not showing up in the stock price.

Abandonware is what the customer wants.

Constant enshittification and UI redesigns are driven by the provider to justify monthly extortion.


I don't know about you, but if I started doing all that instead of writing code as a priority, I'd be fired.

My job is to generate more money, not indulge in code.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: