On Tuesday, 7 April 2015 at 11:36:54 UTC, gjansen wrote:
dmd -O (2.066.1) and gdc -O3 (4.9.2)

But... as I tried to convey, I was comparing apples to oranges. I have now rewritten the D test simply using split(',') instead of csvReader, to be more similar to the python test, and it runs about 2x faster in D with dmd and about 4x faster with gdc compared to Python 3.4.3. :-)

On Tuesday, 7 April 2015 at 10:47:14 UTC, John Colvin wrote:
On Tuesday, 7 April 2015 at 09:44:11 UTC, gjansen wrote:
Many thanks for the feedback yazd! I've tested the approach with a large csv file and it works fine. Unfortunately csvReader seems very convenient but it is no speed daemon. To my dismay it was much slower (about 4x) than a simple approach I am using in Python, which is essentially equivalent to chomp(line).split(','). I guess I'll have to keep studying and learning. Thx again.

What compiler are you using? What compilation flags?

also consider:
-inline and -release
for dmd and
-frelease
for gdc

With gdc, if you are building for a specific cpu family (e.g. broadwell) -march= can provide improvements. -march=native chooses the same as the host machine.

Reply via email to