bitter-ability-32190
11/11/2021, 4:30 PMper_file_caching
option to each linter itself?
I'm thinking some linters are faster than others (pylint
traverses imports and does crazy inference, whereas black
does very little work).
The tipping point here would be something like pylint
is faster to read from the cache than run, but for black
the difference might be in the noisehundreds-father-404
11/11/2021, 4:34 PMbitter-ability-32190
11/11/2021, 4:36 PMbitter-ability-32190
11/11/2021, 4:57 PM--lint-per-file-caching
on pylint
in our repo 😂bitter-ability-32190
11/11/2021, 4:57 PMhundreds-father-404
11/11/2021, 5:15 PM./pants lint dir::
or dir:
bitter-ability-32190
11/11/2021, 5:34 PMisort
(we don't use black
gets less performant), but pylint
did as well, by a long shot...bitter-ability-32190
11/11/2021, 5:35 PMpylint
went from ~15s one-process to ~72s per-file. Does Pants still spin up the subprocess if the result should be cached?hundreds-father-404
11/11/2021, 5:36 PMhundreds-father-404
11/11/2021, 5:37 PMDoes Pants still spin up the subprocess if the result should be cached?This is where you will want to test both cold cache and warm cache, using the techniques from the Pants Debugging page I sent Cold cache is always going to be slower with per-process. But the question is how much worse, and how much faster is warm cache where it's worth it?
hundreds-father-404
11/11/2021, 5:37 PMbitter-ability-32190
11/11/2021, 5:38 PMbitter-ability-32190
11/11/2021, 5:39 PMbitter-ability-32190
11/11/2021, 5:41 PMhundreds-father-404
11/11/2021, 5:53 PMbitter-ability-32190
11/11/2021, 5:57 PM11:51:08.36 [INFO] Completed: Lint using Pylint - Pylint succeeded.
so I'm going to try again with -lwarn
.
I also noticed I was running with ./pants_from_sources
. Perhaps that does something different than just ./pants
bitter-ability-32190
11/11/2021, 6:00 PMjoshuacannon@CEPHANDRIUS:~/work/techlabs$ time ./pants -lwarn --isort-skip --yapf-skip --lint-per-file-caching lint ::
...
real 1m14.204s
user 0m0.398s
sys 0m0.058s
hundreds-father-404
11/11/2021, 6:03 PM./pants_from_sources
doesn't use pantsd by defaultbitter-ability-32190
11/11/2021, 6:06 PMbitter-ability-32190
11/11/2021, 6:17 PMhundreds-father-404
11/11/2021, 6:19 PM./pants --no-pantsd lint path/to/f.py
is not caching from disk when you run it three times in a row? Regardless of --per-file-caching
? I don't reproduce, so trying to figure out what's upbitter-ability-32190
11/11/2021, 6:27 PM12:26:59.55 [INFO] Counters:
local_cache_read_errors: 0
local_cache_requests: 36
local_cache_requests_cached: 27
local_cache_requests_uncached: 9
local_cache_total_time_saved_ms: 145684
local_cache_write_errors: 0
local_execution_requests: 9
local_process_total_time_run_ms: 952
I guess if there was a good way to see where the time was being spent by pants
, this'd be a lot easier to reason about 😕bitter-ability-32190
11/11/2021, 6:28 PMbitter-ability-32190
11/11/2021, 6:29 PM