[cfe-dev] Massive performance regression in clang 3.9

Andy Gibbs via cfe-dev cfe-dev at lists.llvm.org
Wed Oct 19 02:44:18 PDT 2016


Hi,

I have observed a massive performance regression when upgrading from clang 3.7 
to 3.9.  I have also checked that current tip-of-trunk seems to have this 
regression too.

I have managed to isolate the patch at which the regression appeared as 
r248431 on 23rd Sept 2015.

I have attached a simple test-case that demonstrates the problem rather 
effectively.

Prior to r248431, this code would compile in under 20 seconds, consuming 
approx. 400Mb of memory.  GCC, for comparison, takes longer at around 50 
seconds on my machine but consumes only ~250Mb.

Following patch r248431 and all the way up to tip-of-trunk, clang is 
terminated by the OOM handler due excessive memory usage in excess of 7 
Gigabytes!!!

This seems a little unreasonable -- the test-code in question is a little 
pathological maybe but is designed to exploit template memoisation, so the 
excessive memory usage would imply to me that this memoisation is no longer 
working.

Is anyone else able to confirm my findings?  If so, I will raise this as a bug 
report.  Richard, I have copied you as the author of the patch in question 
(hope you don't mind!).

Cheers,
Andy

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.cpp
Type: text/x-c++src
Size: 1269 bytes
Desc: test.cpp
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20161019/d74cf138/attachment.cpp>


More information about the cfe-dev mailing list