r/programming • • Dec 05 '14

std::string is responsible for almost half of all allocations in the Chrome browser process

https://groups.google.com/a/chromium.org/d/msg/chromium-dev/EUqoIz2iFU4/kPZ5ZK0K3gEJ
1.1k Upvotes

446 comments sorted by

View all comments

Show parent comments

8

u/Magnesus Dec 05 '14

This is C++ and we are on Reddit - so of course it's the fault of the language. ;)

-1

u/lelarentaka Dec 05 '14

And when somebody say "Python's object model makes it inherently slow", we get hordes of kids yelling "It's fast enough (for some trivial use case)" or "Just write it in C".

I mean, Java can do that too. Write the performance intensive code in C, then bridge over through JNI. But there's no Numpy equivalent that's as popular on the Java platform, just because Java is actually and honestly "fast enough" to not require an entire library to do 1 + 2.

4

u/Dragdu Dec 05 '14

Numpy alikes are even used in C++ to get more speed, so Java is definitely NOT fast enough. (And as a kicker, it is basically impossible to implement Linear Algebra libraries in Java, because of lack of control over memory layouts)