r/programming • • 4d ago

Java4Shell is a reason to use Java

https://mccue.dev/pages/11-18-26-java4shell
36 Upvotes

49 comments sorted by

View all comments

Show parent comment

39

u/Professional_Price89 4d ago

"Faster than C", then show a 71% slower than C table.

10

u/za3faran_tea 3d ago

Some guys on the JDK team benchmarked the caffeine caching library (written in Java) with a similar one Moka (written in Rust), and Java had lower CPU usage and lower latencies at the same throughput

7

u/coderemover 2d ago

Do you have a link? A benchmark without information how to reproduce is just an ad.

0

u/za3faran_tea 1d ago

I don't, but here's the chart: https://imgur.com/a/LUG597k

4

u/coderemover 1d ago

It’s garbage. It doesn’t even say what allocator was used and what size of objects. I did benchmark mimalloc against ZGC using a high residency database-like workload and Rust ran circles around Java in all aspects, including CPU spent on memory management.

-39

u/bowbahdoe 4d ago

It can be faster, but 71% slower is still competitive

38

u/gredr 4d ago

You have a weird definition of "competitive".

5

u/coderemover 2d ago

71% slower by wall clock. What about CPU and memory usage?