Two performance hacks in build file parsing.

Review Request #2895 — Created Sept. 26, 2015 and submitted

benjyw
pants
5700449...
pants-reviews
jsirois, patricklaw
1. Ignore hidden dirs when scanning for BUILD files.

It can be expensive to scan inside .git, .pants.d, .local_artifact_cache
and so on, and this is never what the user means by :: anyway.

This cut the run time of ./pants list from 50 to 25 seconds at Foursquare.

2. Memoize the addressable factory instances.

This cut the run time down further, from 25 to 20 seconds.

CI passes: https://travis-ci.org/pantsbuild/pants/builds/82244881.

  • 0
  • 0
  • 1
  • 0
  • 1
Description From Last Updated
PA
  1. 
      
  2. typo: addressible -> addressable

    1. haha, I'm glad other people look for spelling issues because I'm awful at catching them.

    2. Fixed, and also made it 'private'.

  3. src/python/pants/base/build_file.py (Diff revision 1)
     
     

    Fine to exclude the brackets and pass a generator expression. Theoretically faster and it looks nicer.

  4. I would also appreciate a test here that exercised the logic which allows either a buildroot relative path or an absolute path.

    1. Added a test for that.

  5. 
      
MO
  1. Ship It!
  2. 
      
BE
BE
Review request changed

Status: Closed (submitted)

Change Summary:

3a97918e305e2be2fdf39b07252b1fbfcdde389b

BE
  1. Thanks Patrick! Submitted as 3a97918e305e2be2fdf39b07252b1fbfcdde389b.

  2. 
      
Loading...