https://pantsbuild.org/ logo
#development
Title
# development
h

hundreds-father-404

05/15/2019, 8:28 PM
Settled on a good technique to profile this: Python’s
tracemalloc
library. Apply the below diff, then comparing
./pants --no-v1 --v2 test tests/python/pants_test/util:strutil
vs
./pants list tests/python/pants_test/util:strutil
shows that there indeed is something very very large getting sent to the engine
Copy code
./pants --no-v1 --v2 test tests/python/pants_test/util:strutil

[<Statistic traceback=<Traceback (<Frame filename='/Users/eric/DocsLocal/code/projects/pants/src/python/pants/engine/native.py' lineno=532>,)> size=20560 count=257>,
 <Statistic traceback=<Traceback (<Frame filename='/Users/eric/DocsLocal/code/projects/pants/src/python/pants/engine/native.py' lineno=370>,)> size=7978 count=4>,
 <Statistic traceback=<Traceback (<Frame filename='/Users/eric/DocsLocal/code/projects/pants/build-support/pants_dev_deps.py36.venv/lib/python3.6/_weakrefset.py' lineno=84>,)> size=5984 count=37>,
 <Statistic traceback=<Traceback (<Frame filename='<string>' lineno=14>,)> size=3128 count=37>,
 <Statistic traceback=<Traceback (<Frame filename='/Users/eric/DocsLocal/code/projects/pants/src/python/pants/source/source_root.py' lineno=290>,)> size=2192 count=42>,
 <Statistic traceback=<Traceback (<Frame filename='/Users/eric/DocsLocal/code/projects/pants/src/python/pants/source/source_root.py' lineno=316>,)> size=1400 count=25>,
 <Statistic traceback=<Traceback (<Frame filename='/Users/eric/DocsLocal/code/projects/pants/src/python/pants/engine/native.py' lineno=463>,)> size=1376 count=21>,
 <Statistic traceback=<Traceback (<Frame filename='/Users/eric/DocsLocal/code/projects/pants/src/python/pants/engine/native.py' lineno=376>,)> size=1284 count=13>,
 <Statistic traceback=<Traceback (<Frame filename='/Users/eric/DocsLocal/code/projects/pants/src/python/pants/reporting/report.py' lineno=138>,)> size=960 count=15>,
 <Statistic traceback=<Traceback (<Frame filename='/Users/eric/DocsLocal/code/projects/pants/src/python/pants/source/source_root.py' lineno=356>,)> size=810 count=15>]
Copy code
./pants list tests/python/pants_test/util:strutil
tests/python/pants_test/util:strutil
[<Statistic traceback=<Traceback (<Frame filename='/Users/eric/DocsLocal/code/projects/pants/src/python/pants/engine/native.py' lineno=532>,)> size=6640 count=83>,
 <Statistic traceback=<Traceback (<Frame filename='/Users/eric/DocsLocal/code/projects/pants/src/python/pants/engine/addressable.py' lineno=132>,)> size=5920 count=20>,
 <Statistic traceback=<Traceback (<Frame filename='/Users/eric/DocsLocal/code/projects/pants/src/python/pants/engine/legacy/parser.py' lineno=139>,)> size=4229 count=60>,
 <Statistic traceback=<Traceback (<Frame filename='/Users/eric/DocsLocal/code/projects/pants/src/python/pants/engine/native.py' lineno=370>,)> size=3998 count=1>,
 <Statistic traceback=<Traceback (<Frame filename='<unknown>' lineno=0>,)> size=3872 count=8>,
 <Statistic traceback=<Traceback (<Frame filename='/Users/eric/DocsLocal/code/projects/pants/src/python/pants/util/objects.py' lineno=109>,)> size=3216 count=7>,
 <Statistic traceback=<Traceback (<Frame filename='/Users/eric/DocsLocal/code/projects/pants/src/python/pants/engine/mapper.py' lineno=138>,)> size=3104 count=24>,
 <Statistic traceback=<Traceback (<Frame filename='/Users/eric/DocsLocal/code/projects/pants/src/python/pants/build_graph/address.py' lineno=179>,)> size=2720 count=41>,
 <Statistic traceback=<Traceback (<Frame filename='/Users/eric/DocsLocal/code/projects/pants/src/python/pants/engine/mapper.py' lineno=127>,)> size=2416 count=26>,
 <Statistic traceback=<Traceback (<Frame filename='/Users/eric/DocsLocal/code/projects/pants/build-support/pants_dev_deps.py36.venv/lib/python3.6/encodings/unicode_escape.py' lineno=13>,)> size=2200 count=12>
]