flat-zoo-31952
07/06/2022, 5:25 PM./pants --changed-since=HEAD --changed-dependees=transitive list
It's gone from about 1 min to 2 min from 2.11.0 to 2.13.0a0. I can reproduce these times pretty consistently by flipping between branches with the different versions and then killing pantsd and nuking the lmdb_store and named_caches. More details in š§µhundreds-father-404
07/06/2022, 5:28 PM--owners-not-found-behavior
is not used: https://github.com/pantsbuild/pants/pull/15931hundreds-father-404
07/06/2022, 5:29 PMflat-zoo-31952
07/06/2022, 5:37 PM| xargs something-else
) tacked on one line later and that second command has to do the whole dependee check againhundreds-father-404
07/06/2022, 5:41 PMxargs
is messing things up. In the past, I vaguely recall it messing up thingsflat-zoo-31952
07/06/2022, 5:41 PMtime ./pants list --changed-since=HEAD --changed-dependees=transitive > artifacts/transitive.targets.txt
time ./pants --spec-files=artifacts/transitive.targets.txt filter --target-type=python_test --granularity=file '--tag-regex=^unit$' '--address-regex=-^pants-plugins'
time ./pants --spec-files=artifacts/transitive.targets.txt filter --target-type=python_test --granularity=file '--tag-regex=^local$' '--address-regex=-^pants-plugins'
time ./pants --spec-files=artifacts/transitive.targets.txt filter --target-type=python_test --granularity=file '--tag-regex=^systest$' '--address-regex=-^pants-plugins'
time ./pants --changed-since=main --changed-dependees=direct list \
| xargs ./pants filter --target-type=test_component \
| xargs ./pants dependees \
| xargs ./pants filter --tag-regex='^systest-long$' \
| xargs ./pants source-files
time ./pants --changed-since=main --changed-dependees=direct list \
| xargs ./pants filter --target-type=test_component \
| xargs ./pants dependees \
| xargs ./pants filter --tag-regex='^systest-multicloud$' \
| xargs ./pants source-files
That last command is exactly like the one before it, except it uses a different tag to filter on (I know filtering is deprecated, haven't gotten around to changing it yet.) But the cache misses completely on xargs ./pants dependees
in that last command and it has to recompute the entire dep graph (which takes another 2m20s š
)hundreds-father-404
07/06/2022, 5:42 PMfilter
goal -- you can use --filter-target-type
etc from anywhere šflat-zoo-31952
07/06/2022, 5:42 PMflat-zoo-31952
07/06/2022, 5:43 PMflat-zoo-31952
07/06/2022, 5:44 PMreal 0m11.609s
user 0m3.131s
sys 0m0.389s
real 2m44.740s
user 0m3.125s
sys 0m0.389s
witty-crayon-22786
07/06/2022, 5:46 PMwitty-crayon-22786
07/06/2022, 5:46 PMwitty-crayon-22786
07/06/2022, 5:46 PMwitty-crayon-22786
07/06/2022, 5:47 PMflat-zoo-31952
07/06/2022, 5:47 PMwitty-crayon-22786
07/06/2022, 5:47 PMflat-zoo-31952
07/06/2022, 5:54 PMreal 1m27.762s
user 0m0.620s
sys 0m0.076s
And that cache miss happened againwitty-crayon-22786
07/06/2022, 5:55 PMflat-zoo-31952
07/06/2022, 5:55 PM--owners-not-found-behavior
because I don't specify anything related to ithundreds-father-404
07/06/2022, 5:56 PMflat-zoo-31952
07/06/2022, 5:58 PMwitty-crayon-22786
07/06/2022, 6:00 PMwitty-crayon-22786
07/06/2022, 6:01 PMflat-zoo-31952
07/06/2022, 6:02 PMflat-zoo-31952
07/06/2022, 6:37 PM./pants dependees ::
flat-zoo-31952
07/06/2022, 6:38 PM./pants --no-pantsd dependees ::
is consistently slow; I would have expected some of the work would be cached to disk, so I find this surprisingflat-zoo-31952
07/06/2022, 6:39 PM⯠for i in (seq 1 10)
echo "Trial #$i"
time ./pants --no-pantsd dependees ::
end
Trial #1
ā “ 57.09s Searching for `bash` on PATH=/usr/bin:/bin:/usr/local/bin
ā “ 70.27s Map all targets to their dependees
________________________________________________________
Executed in 115.58 secs fish external
usr time 138.44 secs 333.00 micros 138.44 secs
sys time 15.15 secs 82.00 micros 15.15 secs
Trial #2
________________________________________________________
Executed in 95.70 secs fish external
usr time 114.68 secs 0.00 micros 114.68 secs
sys time 12.70 secs 533.00 micros 12.70 secs
Trial #3
________________________________________________________
Executed in 90.90 secs fish external
usr time 108.60 secs 0.00 micros 108.60 secs
sys time 11.85 secs 515.00 micros 11.85 secs
flat-zoo-31952
07/06/2022, 6:39 PMflat-zoo-31952
07/06/2022, 6:45 PM./pants tailor
I get a major speedup
⯠time ./pants --no-pantsd dependees ::
________________________________________________________
Executed in 50.06 secs fish external
usr time 60.92 secs 769.00 micros 60.92 secs
sys time 7.21 secs 901.00 micros 7.21 secs
flat-zoo-31952
07/06/2022, 6:53 PMwitty-crayon-22786
07/06/2022, 6:56 PMpantsd
. but consuming the outputs of those processes to actually construct the graph is only memoized by pantsd
witty-crayon-22786
07/06/2022, 6:57 PMpantsd
as approximately equivalent to āreading the BUILD files from diskāflat-zoo-31952
07/06/2022, 6:57 PMwitty-crayon-22786
07/06/2022, 6:58 PMflat-zoo-31952
07/06/2022, 6:58 PMwitty-crayon-22786
07/06/2022, 7:04 PMwhy does that take 50 sec?good question! gathering a trace of the usecase would be useful. Toolchain has infrastructure for collecting the āworkunitsā via a plugin⦠in the absence of that, i think that Joshua Cannon had also worked on something to collect and aggregate the workunits
flat-zoo-31952
07/06/2022, 7:05 PM./pants --no-pantsd dependees ::
if I get rid of all recursively defined targets and replace them with 111 build file defswitty-crayon-22786
07/06/2022, 7:07 PMflat-zoo-31952
07/06/2022, 7:07 PMwitty-crayon-22786
07/06/2022, 7:07 PMflat-zoo-31952
07/06/2022, 7:08 PMwitty-crayon-22786
07/06/2022, 7:08 PMflat-zoo-31952
07/06/2022, 7:09 PMi would think that fewer targets would take less time to match in that case. worth following up on.I didn't have fewer targets, I had fewer owners. I was using a bunch of
sources=["dir/**/*.py"]
happy-kitchen-89482
07/06/2022, 7:10 PMhappy-kitchen-89482
07/06/2022, 7:10 PMflat-zoo-31952
07/06/2022, 7:11 PMflat-zoo-31952
07/06/2022, 7:14 PMwitty-crayon-22786
07/06/2022, 7:16 PMwitty-crayon-22786
07/06/2022, 7:17 PMflat-zoo-31952
07/06/2022, 7:18 PMflat-zoo-31952
07/06/2022, 7:20 PM./pants tailor
working locally on all dev machines before I can get rid of itwitty-crayon-22786
07/06/2022, 8:30 PMwitty-crayon-22786
07/06/2022, 8:30 PMflat-zoo-31952
07/07/2022, 1:19 PMwitty-crayon-22786
07/07/2022, 5:11 PMflat-zoo-31952
07/10/2022, 6:08 PMflat-zoo-31952
07/10/2022, 6:34 PM-ldebug
has some relevant info... this is an excerpt, looks to me like it's stalling on getting a sandbox to look for python binaries?
14:24:36.68 [DEBUG] Launching 1 roots (poll=false).
14:24:37.83 [DEBUG] Completed: Find all targets in the project
14:24:47.25 [DEBUG] Completed: acquire_command_runner_slot
14:24:47.25 [DEBUG] Running Searching for `python3.10` on PATH=/usr/bin under semaphore with concurrency id: 5, and concurrency: 1
14:24:47.25 [DEBUG] Completed: acquire_command_runner_slot
14:24:47.25 [DEBUG] Running Searching for `python3.9` on PATH=/usr/bin under semaphore with concurrency id: 6, and concurrency: 1
14:24:47.26 [DEBUG] Completed: Extracting an archive file
14:24:47.26 [DEBUG] Completed: pants.core.util_rules.external_tool.download_external_tool
14:25:48.97 [DEBUG] Completed: setup_sandbox
14:25:48.97 [DEBUG] Completed: setup_sandbox
14:25:48.97 [DEBUG] Obtaining exclusive spawn lock for process since we materialized its executable Some("./find_binary.sh").
14:25:48.97 [DEBUG] Obtaining exclusive spawn lock for process since we materialized its executable Some("./find_binary.sh").
14:25:57.63 [DEBUG] spawned local process as Some(122486) for Process { argv: ["./find_binary.sh", "python3.10"], env: {"PATH": "/usr/bin"}, working_directory: None, input_digests: InputDigests { complete: DirectoryDigest { digest: Digest { hash: Fingerprint<1824155fc3b856540105ddc768220126b3d9e72531f69c45e3976178373328f3>, size_bytes: 91 }, tree: "Some(..)" }, nailgun: DirectoryDigest { digest: Digest { hash: Fingerprint<e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855>, size_bytes: 0 }, tree: "Some(..)" }, input_files: DirectoryDigest { digest: Digest { hash: Fingerprint<1824155fc3b856540105ddc768220126b3d9e72531f69c45e3976178373328f3>, size_bytes: 91 }, tree: "Some(..)" }, immutable_inputs: {}, use_nailgun: {} }, output_files: {}, output_directories: {}, timeout: None, execution_slot_variable: None, concurrency_available: 0, description: "Searching for `python3.10` on PATH=/usr/bin", level: Debug, append_only_caches: {}, jdk_home: None, platform_constraint: None, cache_scope: PerRestartSuccessful }
14:25:57.86 [DEBUG] spawned local process as Some(122487) for Process { argv: ["./find_binary.sh", "python3.9"], env: {"PATH": "/usr/bin"}, working_directory: None, input_digests: InputDigests { complete: DirectoryDigest { digest: Digest { hash: Fingerprint<1824155fc3b856540105ddc768220126b3d9e72531f69c45e3976178373328f3>, size_bytes: 91 }, tree: "Some(..)" }, nailgun: DirectoryDigest { digest: Digest { hash: Fingerprint<e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855>, size_bytes: 0 }, tree: "Some(..)" }, input_files: DirectoryDigest { digest: Digest { hash: Fingerprint<1824155fc3b856540105ddc768220126b3d9e72531f69c45e3976178373328f3>, size_bytes: 91 }, tree: "Some(..)" }, immutable_inputs: {}, use_nailgun: {} }, output_files: {}, output_directories: {}, timeout: None, execution_slot_variable: None, concurrency_available: 0, description: "Searching for `python3.9` on PATH=/usr/bin", level: Debug, append_only_caches: {}, jdk_home: None, platform_constraint: None, cache_scope: PerRestartSuccessful }
14:25:58.23 [DEBUG] Completed: Searching for `python3.9` on PATH=/usr/bin
14:25:58.23 [DEBUG] Completed: Searching for `python3.10` on PATH=/usr/bin
14:25:58.23 [DEBUG] Completed: Scheduling: Searching for `python3.10` on PATH=/usr/bin
14:25:58.23 [DEBUG] Completed: Scheduling: Searching for `python3.9` on PATH=/usr/bin
hundreds-father-404
07/10/2022, 6:35 PMflat-zoo-31952
07/10/2022, 6:36 PMhundreds-father-404
07/10/2022, 6:37 PMflat-zoo-31952
07/10/2022, 6:37 PMflat-zoo-31952
07/10/2022, 6:47 PMflat-zoo-31952
07/10/2022, 7:11 PMflat-zoo-31952
07/10/2022, 9:48 PMwitty-crayon-22786
07/10/2022, 10:05 PMpantsd
is watching is causing it to constantly restartwitty-crayon-22786
07/10/2022, 10:05 PM--no-pantsd
�)flat-zoo-31952
07/10/2022, 10:06 PMwitty-crayon-22786
07/10/2022, 10:06 PM.pants.d
, dist
or outside of the treeflat-zoo-31952
07/10/2022, 10:07 PM2> /var/tmp/some-file.log
witty-crayon-22786
07/10/2022, 10:08 PMflat-zoo-31952
07/10/2022, 10:09 PMflat-zoo-31952
07/10/2022, 10:09 PMflat-zoo-31952
07/10/2022, 10:13 PMwitty-crayon-22786
07/10/2022, 10:14 PMflat-zoo-31952
07/10/2022, 10:18 PMflat-zoo-31952
07/10/2022, 10:19 PMflat-zoo-31952
07/10/2022, 10:20 PM