Simple performance question from a newcomer

Kapps via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Feb 21 23:10:23 PST 2016


If you do want to test the differences between the range approach 
and the loop approach, something like:
auto sumtest4(Range)(Range range) @safe pure {
	return range.reduce!((a, b) => a + b);
}
is a more fair comparison. I get results within 15% of sumtest2 
with this using dmd. I think with ldc this would be identical, 
but the version in homebrew is too old to compile this.


More information about the Digitalmars-d-learn mailing list