Avoid reparsing analysis repeatedly
Review Request #1938 - Created March 18, 2015 and submitted
- Make compute_classes_by_source abstract
- Require that compute_classes_by_source in the global strategy receives a single classes dir and analysis file
I'll move the previous implementation of this method over to the concrete class on https://rbcommons.com/s/twitter/r/1898/, where it makes more sense.
will begin running a performance test internally to see whether this was the only issue.
I've got one comment wrt the for: else:
I think you need a break in here somewhere, otherwise the else will always be executed, and analysis_file will always equal
If you are just checking that all the compile_context's analysis_file's are the same, you could do something that makes it obvious that that's what you are checking rather than reusing the accumulator, eg
if not all(lambda context: context.analysis_file == self._analysis_file, compile_contexts): raise TaskError("expected all the contexts to reuse the global analysis file")
Use TaskError, and directly check whether compile_contexts is empty.
Working on smoketesting internally before submitting.
Revision 2 (+38 -17)