• Sigurd Schneider's avatar
    [tools] Add script to count lines of code · 53dcadfe
    Sigurd Schneider authored
    This script counts lines of code before and after preprocessor expansion.
    When running:
      tools/locs.py --build-dir out.gn/repro --smallest --largest --worst
    in the v8 directory, it reports:
    
    Processed 1,520 files in 24.62 sec.
    src         (  625 files):   365,679 to   53,468,383 ( 146.22x)
    third_party (  432 files):   239,081 to    9,502,094 (  39.74x)
    gen         (   19 files):    64,040 to    1,415,287 (  22.10x)
    total       ( 1520 files): 1,173,349 to  102,831,949 (  87.64x)
    test        (  392 files):   489,865 to   37,476,036 (  76.50x)
    Largest 3 files after expansion:
       33,495 to      140,401 (   4.19x) gen/torque-generated/builtins-array-from-dsl-gen.cc
      100,014 to      140,111 (   1.40x) ../../test/cctest/gay-precision.cc
      100,014 to      140,110 (   1.40x) ../../test/cctest/gay-shortest.cc
    Worst expansion (3 files):
            6 to      100,826 (14403.71x) ../../test/fuzzer/wasm-data-section.cc
            6 to      100,826 (14403.71x) ../../test/fuzzer/wasm-function-sigs-section.cc
            6 to      100,826 (14403.71x) ../../test/fuzzer/wasm-globals-section.cc
    Smallest 3 input files:
            0 to            0 (   0.00x) ../../testing/gtest/empty.cc
            1 to            0 (   0.00x) ../../src/x64/simulator-x64.cc
            4 to        4,423 ( 884.60x) ../../buildtools/third_party/libc++/trunk/src/utility.cpp
    
    Notry: true
    Change-Id: Ie1da942463d9e6a84338a9bd57d9ddc46d2856dc
    Reviewed-on: https://chromium-review.googlesource.com/c/1349571
    Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
    Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#57822}
    53dcadfe
Name
Last commit
Last update
benchmarks Loading commit data...
build_overrides Loading commit data...
custom_deps Loading commit data...
docs Loading commit data...
gni Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.clang-tidy Loading commit data...
.editorconfig Loading commit data...
.git-blame-ignore-revs Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.vpython Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
LICENSE.fdlibm Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...
snapshot_toolchain.gni Loading commit data...