Perf improvement: rebase analyis file once instead of multiple times

Review Request #4352 - Created Nov. 3, 2016 and submitted

Information
Peiyu Wang
pants
4026
Reviewers
pants-reviews
benjyw, ity, mateor, nhoward_tw, stuhood, wisechengyi, zundel

We have this outstanding issue https://github.com/pantsbuild/zincutils/issues/8 to scan analysis file once, currently it does multiple scans, one per replaced pairs.

In #3962 new zinc analysis files are bigger, almost doubled in time in local testing. Therefore optimization becomes necessary.

From profiling, each of the following accounts for about 1/3 of the rebase total time:

  • file write
  • read() to iterate through lines
  • everything else (string replacement)

This PR cuts the time from the first two items by a factor of two since there are two scans. That nets 1/3 saving

https://travis-ci.org/peiyuwang/pants/builds/173091425
https://travis-ci.org/peiyuwang/pants/builds/174378023

Issues

  • 0
  • 1
  • 0
  • 1
Description From Last Updated
Benjy Weinberger
Peiyu Wang
Stu Hood
Stu Hood
Peiyu Wang
Review request changed

Status: Closed (submitted)

Change Summary:

Commited as 04afcc8476afd5bbff6326485bfb1f66b39b3d72

Loading...