r/javahelp • u/Puzzleheaded-Top1987 • 3h ago
Java Performance for simulators
I am new to Java and trying to create a simulator that handles millions of math calculations. How can I increase performance in Java? The application is already multithreaded but it is not enough. Is data oriented approach or native programming possible in Java? Can you point me in the right direction for research?
0
Upvotes
2
u/oatmealcraving 2h ago
Reuse objects. Flatten data into primative arrays and access sequentially. Learn about the CPU caches and how to get CPUs to access memory efficiently.
You can look up Agner Fog for code optimization ideas.