Page MenuHomeFreeBSD

Limit git history searches in newvers.sh
ClosedPublic

Authored by gallatin on Jan 4 2019, 4:23 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Mar 7, 11:31 PM
Unknown Object (File)
Wed, Feb 28, 2:55 AM
Unknown Object (File)
Dec 22 2023, 10:17 PM
Unknown Object (File)
Oct 22 2023, 10:38 PM
Unknown Object (File)
Sep 16 2023, 4:30 PM
Unknown Object (File)
Aug 23 2023, 6:00 PM
Unknown Object (File)
Jul 1 2023, 12:53 AM
Unknown Object (File)
Jun 28 2023, 4:32 PM
Subscribers

Details

Summary

newvers.sh takes upwards of 4 seconds to complete on trees checked out from github, due to searching the entire history for non-existent git-svn metadata. Similarly, if one does not check out notes, we again search the entire history for notes. That makes newvers.sh very slow for many github users.

To fix this in a fair way, limit the history search to the last 10K commit: if you're more than 10K commits out of sync, then you've forked the project, and our SVN rev is no longer very important to you.

Due to how git implements --grep in conjunction with -n, it has been removed for performance reasons (git does not seem to limit its search to the -n limit in this case, and takes just as long as it did before).

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/conf/newvers.sh
255 ↗(On Diff #52552)

looks like the comment is cut off - it has forked the OS and the svn rev is not important?

sys/conf/newvers.sh
255 ↗(On Diff #52552)

Oh, strange, the comment is indeed there - not sure what happened.

10,000 is a bit arbitrary, but is a decent enough limit. 1k likely would do the trick, but maybe not always and wouldn't help the speed much at all. 100k likely would be measurably slower. I know that patch collections in monta vista linux for just the kernel ran into the thousands back in the day when I had to cope with their insanity, so maybe 10k isn't all that over-high...

sys/conf/newvers.sh
252 ↗(On Diff #52553)

kill the xxxx's please

I tried a few values locally and found:

LimitTime
10000.075
50000.180
100000.298
250000.645
500001.138
1000001.937

LGTM with @imp's comment about XXXs addressed.

This revision is now accepted and ready to land.Jan 4 2019, 4:38 PM
This revision now requires review to proceed.Jan 4 2019, 5:02 PM
This revision is now accepted and ready to land.Jan 4 2019, 5:14 PM
This revision was automatically updated to reflect the committed changes.