AA code 50x slower

AlphaPurned Alpha at Beta.com
Sun Feb 16 12:57:43 UTC 2020


template AA(string[] S)
{
	auto _do() { int[string] d; foreach(s; S) d[s] = 0; return d; }
	enum AA = _do;
}


if (t in AA!(["a", "and", "mp4", "mp3", "the", "with", "live", 
"no", "&", "of", "band"])) continue;		


The if statement literally causes a 50x slow down of the code. 
(LDC debug, dmd debug takes about 1000 times longer)



More information about the Digitalmars-d-learn mailing list