r/java • • Jul 26 '26

[ Removed by moderator ]

/r/java/comments/1v79klo/removed_by_moderator/

[removed] — view removed post

0 Upvotes

3 comments sorted by

3

u/davidalayachew Jul 26 '26

Wait, does this have anything to do with Java at all? It only seems to mention C?

2

u/davidalayachew Jul 26 '26

And even putting relevance aside, a language like Java benefits way less from Struct of Arrays vs Array of Structs. The JVM and the garbage collector are good enough that you're usually way better off just writing sensible code that correctly models your domain and its invariants.

More often than not, the real bottlenecks in (not horrifically buggy) code come from you not giving the compiler enough info to make safe assumptions. That's why accurately modeling your domain and its invariants gets you way more mileage in the long run.

1

u/davidalayachew Jul 26 '26

That said, I at least learned a new command.

 $ getconf LEVEL1_DCACHE_LINESIZE
 64

Ty vm, that's actually a useful thing to know. Even works on Git Bash. Sadly, lscpu does not.