Created attachment 50 [details] Test code This function: int f(int N = 100_000) { int len = 0; foreach (uint i; 1..N) len += to!(char[])(i).length; return len; } runs 4 times slower when compiled with gcd 4.8 compared to gcd 4.6. Run times and compilation details on Xubuntu 13.04 64-bit Core i5 3450S 2.8GHz (3.5GHz turbo): 5.7ms GDC 4.6.4: gdc -m64 -march=native -fno-bounds-check -frename-registers -frelease -O3 23ms GDC 4.8.1: gdc -m64 -march=native -fno-bounds-check -frename-registers -frelease -O3 22ms LDC 0.11.0: ldmd2 -m64 -O -noboundscheck -inline -release 30ms DMD64 2.063.2: dmd -O -noboundscheck -inline -release Attached is test code.
This has probably little to do with GDC itself, but is related to changes in std.conv module. I could measure it only with gdc, hence I reported it here.
(In reply to comment #1) > This has probably little to do with GDC itself, but is related to changes in > std.conv module. I could measure it only with gdc, hence I reported it here. Thanks for your bug report, there are some performance improvements to to!conv in the pipeline for 2.064, would be interesting to get test results then. Also, can you compile the code with -fdump-tree-original for both 4.6 and 4.8 and attach the produced dumps to this report? As well as changes to library code, should also show if there's any changes to compiler code generation that may affect performance. Thanks Iain.
Created attachment 51 [details] -fdump-tree-original for gdc 4.6
Created attachment 52 [details] -fdump-tree-original for gdc 4.8
I added the files you requested, but they are syntactically different: assembly vs. D. I will be glad to run the new gdc version when available.
Argh! Completely forgot I switched to pretty-print dumps between 4.6->4.8. :) Not to worry.
I'll close this as invalid for now. GDC-4.8 with 2.064 frontend is still ~30% faster than dmd 2.064 which seems reasonable. GDC-4.8/2.064 is also ~(3-4) times faster than LDC with 2.063 so it seems there were indeed some performance improvements with the 2.064 frontend release. Anyway, if this is still an issue it's likely an upstream phobos issue, or the changes in 2.064 have already fixed it. Feel free to reopen this issue if you disagree.