[cfe-commits] r125183 - in /cfe/trunk: include/clang/AST/ include/clang/Basic/ lib/AST/ lib/CodeGen/ lib/Sema/ lib/StaticAnalyzer/Checkers/ tools/libclang/

John McCall rjmccall at apple.com
Wed Feb 9 19:28:39 PST 2011


On Feb 9, 2011, at 7:21 PM, Ted Kremenek wrote:
> On Feb 9, 2011, at 6:21 PM, John McCall wrote:
>> On Feb 9, 2011, at 3:56 PM, Ted Kremenek wrote:
>>> Was there a noticeable impact on compile-time?  Memory use?
>> 
>> "Before my patch" is r125182.  "After my patch" is r125185.  All measurements except one are the median of 3 approximately similar results as generated on a not-very-reliable, not-hardly-quiescent laptop.
>> 
>> Cocoa_h.m creates 35700 Stmts/Exprs and 85258 Decls.  On a 64-bit platform, this is a theoretical memory savings of 285,600 bytes for Stmts/Exprs and 682,064 bytes for Decls.
>>   - Before my patch, it allocated 13,008,896 bytes, of which it used 12,449,976, with the remainder being lost to e.g. alignment padding.
>>     A Release build completed 1000 runs (I'm not sure why I did 1000 runs) on my machine with the following characteristics:
>>     daysthatwere:clang rjmccall$ runN 1000 ../../Release/bin/clang -fsyntax-only INPUTS/Cocoa_h.m
>>     name	  avg  	  min  	  med  	  max  	   SD  	 total 
>>     user	 0.3246	 0.3215	 0.3247	 0.3328	 0.0014	324.5585
>>     sys	 0.0771	 0.0662	 0.0819	 0.0898	 0.0068	77.1401
>>     wall	 0.4064	 0.3954	 0.4088	 0.4440	 0.0071	406.4173
>> 
>>   - After my patch, it allocated 12,779,520 bytes, of which it used 12,164,576.  This is a memory savings of 284,400 bytes (used).  1,328,392 bytes of Stmt/Expr nodes were allocated overall.
> 
> The memory savings I see from your numbers is 13,008,896 - 12,779,520 = 229,376 (from the total allocated bytes).  Isn't this the actual memory savings (not 284,400)?

That's a fair point.  I was using "used" because there are things we could do to reduce the overhead from alignment adjustment, whereas there's nothing we can do to reduce the raw "used" overhead, but in terms of immediate effect on the compiler, "allocated" is the better number.

John.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110209/f847156b/attachment.html>


More information about the cfe-commits mailing list