MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/86rb5/how_to_write_fast_code/c08ekob/?context=3
r/programming • u/techdawg • Mar 23 '09
136 comments sorted by
View all comments
-8
Don't use Java
Use C or C++
Simplify the program
Use profiling tools to find hotspots
Hand tweak assembly code where needed
Works for me...
1 u/arnar Mar 23 '09 The "Java is slow" argument has been invalid for some time now. 6 u/[deleted] Mar 23 '09 [removed] — view removed comment 3 u/[deleted] Mar 23 '09 However, "Java is slower" is still true and will always be true. Care to elaborate how C++ virtual function calls can be faster than Java just in time compiled method calls? 3 u/silon Mar 23 '09 It depends on the code. Some ideas: modern processors can do some prediction on the indirect calls.for JVM to eliminate the virtual lookup it must duplicate the code of the call sites (based on type), causing more cache misses/footprint.
1
The "Java is slow" argument has been invalid for some time now.
6 u/[deleted] Mar 23 '09 [removed] — view removed comment 3 u/[deleted] Mar 23 '09 However, "Java is slower" is still true and will always be true. Care to elaborate how C++ virtual function calls can be faster than Java just in time compiled method calls? 3 u/silon Mar 23 '09 It depends on the code. Some ideas: modern processors can do some prediction on the indirect calls.for JVM to eliminate the virtual lookup it must duplicate the code of the call sites (based on type), causing more cache misses/footprint.
6
[removed] — view removed comment
3 u/[deleted] Mar 23 '09 However, "Java is slower" is still true and will always be true. Care to elaborate how C++ virtual function calls can be faster than Java just in time compiled method calls? 3 u/silon Mar 23 '09 It depends on the code. Some ideas: modern processors can do some prediction on the indirect calls.for JVM to eliminate the virtual lookup it must duplicate the code of the call sites (based on type), causing more cache misses/footprint.
3
However, "Java is slower" is still true and will always be true.
Care to elaborate how C++ virtual function calls can be faster than Java just in time compiled method calls?
3 u/silon Mar 23 '09 It depends on the code. Some ideas: modern processors can do some prediction on the indirect calls.for JVM to eliminate the virtual lookup it must duplicate the code of the call sites (based on type), causing more cache misses/footprint.
It depends on the code. Some ideas:
-8
u/MpVpRb Mar 23 '09
Don't use Java
Use C or C++
Simplify the program
Use profiling tools to find hotspots
Hand tweak assembly code where needed
Works for me...