hundreds-father-404
05/16/2019, 3:28 AMExternContext._handles()
after all console rules are finished.
- ./pants list
scales so well because its memory usage is O(1)
.
- ./pants test
is O(t + t*e + b)
, where t
is # of targets, e
is # env
values used in the rule, and n
is # of files in the transitive closure.
- We materialize the build files for each package, with each file about 1000 - 5000 bytes
- Constructing env vars is O(e * t)
. Here, we construct PATH
twice per target / rule invoke, resulting in 600 bytes per target
- test result stdout is O(t)
, about 500 bytes per targetaloof-angle-91616
05/16/2019, 3:56 AMhundreds-father-404
05/16/2019, 3:57 AMci.sh
doesaloof-angle-91616
05/16/2019, 3:58 AMaloof-angle-91616
05/16/2019, 3:58 AMhundreds-father-404
05/16/2019, 4:00 AMcan we bump the memory limit?Maybe? But I think the far better solution is reducing the space complexity to get as close to constant as possible. If
./pants test
crashes Travis on Pants unit tests, imagine trying to run it on Twitter’s entire test suite.aloof-angle-91616
05/16/2019, 4:01 AMhundreds-father-404
05/16/2019, 4:03 AMall that memory might actually be pretty useful?I don’t think so. Look at https://gist.github.com/Eric-Arellano/defca7d864a9f3939448964beea618d4. I don’t think it’s necessary for us to actually materialize the files to Python, nor is it ideal that we keep serializing the env var
PATH
twice for every target.
Serializing TestResult.stdout
is probably fine for now though.aloof-angle-91616
05/16/2019, 4:07 AMaloof-angle-91616
05/16/2019, 4:08 AMaloof-angle-91616
05/16/2019, 4:09 AM