[cfe-dev] Some clang benchmarking on Windows

Francois Pichet pichet2000 at gmail.com
Wed Oct 13 08:54:03 PDT 2010


For people who are curious, I benchmarked MSVC 2008 and 2010 cl.exe
compiler on the same file. Again I used -c (-fsyntax-only)

cl.exe 2008 speed =>   5.6 sec
cl.exe 2010 speed =>   5.7 sec
clang.exe trunk     =>   5.4 sec

clang is slightly faster than MSVC at parsing the non templated Visual
Studio header files.
I ran the test many times on both clang and cl to make sure all header
files were in the cache somewhere because the first time you run it,
your get slower result.

On Mon, Oct 11, 2010 at 3:02 PM, Francois Pichet <pichet2000 at gmail.com> wrote:
> Hi,
>
> I did some benchmarking of clang on Windows this morning, just for fun.
> I used LLVM_TARGETS_TO_BUILD:STRING=all on cmake to include all the
> targets (to be able to compare with what Rafael Espindola posted on
> LLVM-Dev.)
>
> I compiled 4 versions of clang:
>   win32 and /O1
>   win32 and /O2
>   win64 and /O1
>   win64 and /O2
>
> /O1 is Minimize Size (configuration MinSizeRel)
> /O2 is Maximize Speed  (configuration Release)
>
> Everything was compiled using Visual Studio 2008, Windows 7 x64.
>
> clang.exe size:
>   win32 /O1:   9.3 MB      24% smaller
>   win32 /O2:   12.3MB
>   win64 /O1:   15.7 MB    15% smaller
>   win64 /O2:   18.5 MB
>
> Then I used my huge test.cpp that includes all the non templated
> headers of Windows to compare the speed of compilation.
> I used -fsyntax-only.
>
> clang.exe speed (in seconds):
>   win32 /O1:    7.9
>   win32 /O2:    5.4    31% faster
>   win64 /O1:    5.9
>   win64 /O2:    5.4    8% faster
>
>
> Now we need a way to create a new configuration using CMake to enable
> LTO compilation with MSVC.
>




More information about the cfe-dev mailing list