Delay many re.compile calls.

Review Request #3122 — Created Nov. 14, 2015 and submitted

benjyw
pants
pants-reviews
jsirois, patricklaw
This is done either by moving the compile calls out of module scope,
or by importing code lazily.

This takes re.compile from 11% of startup time, and 100s of calls,
to 3.5% of startup time, and tens of calls.

Ran relevant tests locally.
CI passes: https://travis-ci.org/pantsbuild/pants/builds/91066061

JS
  1. Ship It!
  2. 
      
BE
BE
  1. Thanks John! Submitted as 0d95104ee4cc4a27af7549a09c849ed9fdcfdfeb.

  2. 
      
BE
Review request changed

Status: Closed (submitted)

Change Summary:

0d95104ee4cc4a27af7549a09c849ed9fdcfdfeb

ZU
  1. 
      
  2. Thanks for working on making pants faster. I'm sorry I left this code in here so long, it turns out it isn't needed any more. I'm removing it in https://rbcommons.com/s/twitter/r/3123/

    1. Oh, even better! :)

  3. 
      
Loading...