-
Notifications
You must be signed in to change notification settings - Fork 703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PackWriter.buildIndex is too slow #813
Comments
@Tachone the There is definitely room for improvement. The PR #799 add some changes to reduce memory churn, which in turn would decrease GC costs. Would you be able to test the impact on your case with those changes? On your profile graph the cost of using hash.RegisterHash(crypto.SHA1, sha1.New) Note that Another potential optimisation here would be to bring parallelism to |
@Tachone if you are keen on using |
In my case,call But i still think it‘s helpful, due to the decreased GC pressure and the garbage collection costs. I will test the impact on my case. Is #799 ready for production and release later? |
@Tachone yes, hoping to get more folks to test and review the PR. From my point of view it is ready to go. |
When I executed
UploadPack()
and got an 8G packfile,dotgit.(*PackWriter).buildIndex
took 30 hours to generate the corresponding.idx
, most of the cpu time was spent inpackfile.(*Parser).resolveDeltas
See pprof.
cpu:
heap:
But use
git index-pack --strict --threads=16
directly to generate.idx
in 2 hours. Is there room for optimization in go-git for this scenario?The optimization method I can think of is after generating
.pack
throughUploadPack
, directly exec commandgit index-pack --strict --threads=16
to generate.idx
, then callObjectStorage.Reindex()
to reload index,EncodedObject(t plumbing.ObjectType, h plumbing.Hash)
to trigger reload packfile.Will there be any problems with this, and any other optimization suggestions?
The text was updated successfully, but these errors were encountered: