On Thu, 03 Apr 2008 19:12:27 GMT, Erik Wikstr??m
<Erik-wikstrom@telia.com> wrote:
A few days ago some expressed the opinion (in a post I can't find, but
it was probably in one of Razii's threads) that Java's iterators were
better than C++ iterators, or at least that the Java iterator concept
was better (or something to that effect). I would be interested to hear
about why whoever wrote it feels that way.
For fun, I sent the blog page
(http://razi2.blogspot.com/2008/04/why-is-c-slower-than-java.html )
to the author of
http://bruscy.multicon.pl/pages/przemek/java_not_really_faster_than_cpp.html
his email response was:
-- quote--
see explanation to hash.cpp and hash2.cpp on my webpage.
If you use standard library as defined in 1998, you can't make the C++
faster. You either have to use original SGI STL map or unordered_map
from C++ 0x . (Or any hashmap from less standard sources like Boost).
With any of these solutions, C++ beats Java hands down.
There are other performance problems in the code, like this line:
std::string input( buffer.str() );
which needlessly copies the whole 40MB for the second time, but the
performance impact of that is insignificant in comparison to the
impact of using tree based map.
-- end quote ---
I am not sure what that really means but I am still waiting for C++
version that is faster and would compile on GCC.