Hereunder are two short code snippets, one in C++ and one in Python, doing in principle the same simple text processing.
When running both on a large text file (i.e. Shakespeare' integral words as an UTF-8 or ASCII file from Gutenberg.org, it appears that the Python code runs five times faster, under Mac with Python 2.7.10 and g++ from Xcode (2016-11)).
Question: Did I make an ostensible mistake in the C++ test hereunder?
#include
#include
#include
#include
No comments:
Post a Comment