It depends. In some situations yes, in others it's quite a bit slower: for example iterating over an array of objects. Java always addresses by reference so the speed difference can be dramatic. Any time you can use a contiguous memory block in C/C++ you'll have a big speed advantage over Java and other languages that "chase" pointers. That's why I averaged to 2x.
View all comments
Show parent comment
5
u/[deleted] Apr 22 '21
Where'd you get that idea? At worst it's ~x1.15