[cfe-dev] Memory and time consumption for larger files

Douglas Gregor dgregor at apple.com
Mon Mar 29 08:54:32 PDT 2010


On Mar 29, 2010, at 8:37 AM, ihusar wrote:
> 1) g++ -DLISSOM_SEM -O0 -c -o tst.o clang-large-source.c
> (time is only illustrative, because object code file is generated)
> time: 12m17.064s
> top memory approx: 2.6 GB
> 
> 
> 2) llvm-g++ -DLISSOM_SEM -O0 -c --emit-llvm -o tst.bc clang-large-source.c
> time: 6m28.518s
> top memory approx: 8 GB
> 
> 3a) clang -DLISSOM_SEM -DCLANG -c -O0 -o tst.bc clang-large-source.c
> time: 11m15.332s
> top memory  approx 8 GB


When we're testing Clang's performance, we tend to test the different phases of translation to determine where we have a performance problem. For example:

	1) Using the -E option tests preprocessing performance
	2) Using the -fsyntax-only option tests parsing/semantic analysis performance (its time includes (1))
	3) Using the -emit-llvm option tests IR generation performance (its time includes (1) and (2))

llvm-g++ takes the same command-line options, so one can build up a chart fairly quickly to see which phase of Clang's translation is slower than llvm-g++'s corresponding phase. That would tell us where we need to look to start optimizing.

	- Doug



More information about the cfe-dev mailing list