[llvm-dev] [tablegen] table readability / performance

Luke Drummond via llvm-dev llvm-dev at lists.llvm.org
Wed Jan 15 10:41:56 PST 2020


Hi

On Tue Jan 14, 2020 at 8:27 PM, Reid Kleckner wrote:
> I don't think there's any technical reason for the current structure.
> Your
> change sounds like an improvement to me. I'm curious if you have any
> compile time measurements from this change.

I can't find a good permanent place to dump my test files (they're too
large to paste here, but the gist is):

cd $BUILD
awk '
    /InstrNameData\[\] = / {printing = 1}
    (printing) {print} /};$/
    {printing = 0}
' `grep InstrInfo.inc: build.ninja | awk '{print $2}' | tr -d :` > ~/after.cpp

for both with and without my proposed fix.

...and then:

    clang++ before.cpp -S  0.59s user 0.06s system 96% cpu 0.668 total
    clang++ before.cpp -S  0.62s user 0.02s system 99% cpu 0.643 total
    clang++ before.cpp -S  0.61s user 0.03s system 99% cpu 0.639 total
    clang++ after.cpp -S  0.03s user 0.01s system 99% cpu 0.043 total
    clang++ after.cpp -S  0.03s user 0.02s system 99% cpu 0.049 total
    clang++ after.cpp -S  0.03s user 0.02s system 99% cpu 0.046 total
    g++ before.cpp -S  0.70s user 0.05s system 99% cpu 0.747 total
    g++ before.cpp -S  0.72s user 0.04s system 99% cpu 0.762 total
    g++ before.cpp -S  0.71s user 0.04s system 99% cpu 0.745 total
    g++ after.cpp -S  0.01s user 0.01s system 99% cpu 0.022 total
    g++ after.cpp -S  0.02s user 0.01s system 99% cpu 0.025 total
    g++ after.cpp -S  0.02s user 0.00s system 99% cpu 0.026 total

clang is (Debian) version 8.0.1-4 (tags/RELEASE_801/final)
gcc is (Debian 9.2.1-23) 9.2.1 20200110
Host is x86_64 Linux i7

I'll post the patch to Phabricator as soon as I'm able.

Thanks for your input.

Luke

-- 
Codeplay Software Ltd.
Company registered in England and Wales, number: 04567874
Registered office: Regent House, 316 Beulah Hill, London, SE19 3HF


More information about the llvm-dev mailing list