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

witty-crayon-22786

07/13/2022, 4:38 PM
@bitter-ability-32190: re:
py-spy
profiling: it basically looks like: 1. launching
pantsd
with something simple like
help
2. attaching with:
Copy code
py-spy record -p $pid -f speedscope -o $outputfile
3. running the relevant command 4. opening it in https://www.speedscope.app/
b

bitter-ability-32190

07/13/2022, 4:38 PM
Right. I wrote the docs on using py-spy 😅
w

witty-crayon-22786

07/13/2022, 4:38 PM
hah, whoops.
b

bitter-ability-32190

07/13/2022, 4:39 PM
I was wondering what it looks like today, without having to run it myself
w

witty-crayon-22786

07/13/2022, 4:39 PM
ah. sure.
i’ll grab something from
main
. but the short answer is:
Target
construction and validation is next up, afaict
(keeping in mind that
py-spy
is blind to the rust side of things… but the majority of time according to Instruments is in python code, so)
f

flat-zoo-31952

07/13/2022, 4:46 PM
This Josh appreciates that, as I'm trying to profile something myself 😅
w

witty-crayon-22786

07/13/2022, 4:53 PM
@bitter-ability-32190: for
./pants dependencies ::
in
pantsbuild/pants
after #16160: left-heavy view in thread 5, 8, 9, and 10 is most interesting
@flat-zoo-31952: yea, interested in anything you grab! we’ve found you 19% and 12% so far. but nothing algorithmic so far.
f

flat-zoo-31952

07/13/2022, 4:55 PM
ah i missed the thread view, that explains the time thing
w

witty-crayon-22786

07/13/2022, 4:57 PM
@flat-zoo-31952: the whole thing is partitioned by thread, in the very top middle of the screen. so each view shows you a single thread at a time, and won’t show you the portions where the thread was unused/idle
coke
yea. and the “Left-Heavy” view shows you callsites as a fraction, which is more interesting for “overheads”
in theory Time Order would be good for algorithmic stuff, but we’re so async that it doesn’t tend to show much.
whoooa. so. right off the bat in your profile: all of the worker threads are spending ~85% of their time in
find_owners
/
matches_filespec
i have a theory
f

flat-zoo-31952

07/13/2022, 5:01 PM
awesome
5 Views