3 ms·
Great post, I agree with almost all of what you said except the C++ part. I think the difference is that allocations in C++ tend to be a lot more obvious since
by overgard 12y ago
Great post, I agree with almost all of what you said except the C++ part. I think the difference is that allocations in C++ tend to be a lot more obvious since almost all of them are pretty explicit and object lifetime has to be managed. I think with JIT's and so on, a lot of highler level languages can be almost as fast calculation wise, but they encourage a style that's just a low slower, because a lot of of slow operations don't look slow.
This is a much better treatment of it:
http://vimeo.com/61044810 http://vimeo.com/61044810
http://www.slideshare.net/heroku/alex-gaynor-rdiowaza2013 http://www.slideshare.net/heroku/alex-gaynor-rdiowaza2013
- pron 12y agoWhat you're saying may be true for Python, but not Java. Java achieves a higher memory allocation/deallocation throughput than C++ -- the problems associated with Java GCs have to do with worst-case latency (which is solved by some commercial GCs).
- pkolaczk 12y ago"I think the difference is that allocations in C++ tend to be a lot more obvious since almost all of them are pretty explicit." Once you start using standard library classes, even the basic ones like std::string or std::vector, they are not. There are lots of allocations/deallocations happening below, and they tend to be slower than in Java.