[llvm-bugs] [Bug 38430] New: Preprocessing is much slower than GCC on small files

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 2 11:45:53 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=38430

            Bug ID: 38430
           Summary: Preprocessing is much slower than GCC on small files
           Product: clang
           Version: 6.0
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: husseydevin at gmail.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 20634
  --> https://bugs.llvm.org/attachment.cgi?id=20634&action=edit
Makefile

Clang 6.0.1, installed from Termux repos.
GCC 8.2.0, installed from its-pointless.github.io
Termux, LG G3
System information:
Linux localhost 3.4.113-LineageXTD-R7 #1 SMP PREEMPT Fri Jun 15 20:42:06 CEST
2018 armv7l Android
Termux-packages arch:
arm
Android version:
8.1.0, LineageOS
Device manufacturer:
LGE
Device model:
LG-D851

Note that I have gotten similar results on Ubuntu WSL, but I need to do further
testing.

While preprocessing very large files has a similar result with clang sometimes
being faster, clang has terrible performance when invoked many times in a row
with small files:

For example, cd to your main include directory, and run these shell commands:

mkdir -p ~/cpptest
I=0
for file in *.h; do
    echo "#include <$file>" > ~/cpptest/$I.h
    I=$((I+1));
done

Now, put the attached Makefile in ~/cpptest and time make, first with
CPP="clang-6.0 -E", make clean, and next with CPP="gcc-8 -E". Remove any lines
or files that error and run again.

$ time make CPP="clang-6.0 -E"

real    1m14.787s
user    0m46.860s
sys     0m22.390s
$ make clean
$ time make CPP="gcc-8 -E"

real    0.19.910s
user    0m11.390s
sys     0m5.880s
$

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180802/1a149164/attachment.html>


More information about the llvm-bugs mailing list