-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Improve render directory #15891
Improve render directory #15891
Conversation
This PR represents a small improvement for the native git backend's get last commit. It reduces the time taken on ports from 13s to 9s which is just 1s slower than the go-git variant. Signed-off-by: Andrew Thornton <[email protected]>
I think I've cracked this somewhat. |
Signed-off-by: Andrew Thornton <[email protected]>
…to improve-get-lastcommit
Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #15891 +/- ##
==========================================
- Coverage 44.10% 44.08% -0.02%
==========================================
Files 682 682
Lines 82375 82521 +146
==========================================
+ Hits 36328 36381 +53
- Misses 40140 40212 +72
- Partials 5907 5928 +21
Continue to review full report at Codecov.
|
Finally we are faster than go-git on ports for the root directory Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Set the missing discard(1) in repo_language_stats. Signed-off-by: Andrew Thornton <[email protected]>
…to improve-get-lastcommit
Thanks for your effort. Unfortunately, haven't see an obvious increment of the speed of linux kernel repo. I tested with linux kernel home page, my test env is macOS |
@lunny can you double check that test repo has a commit-graph written? |
(in .git/objects/info/commit-graph) |
It's really weird as I am I get 2s for rendering git.git on my laptop. Could you try: https://github.com/zeripath/gitea/tree/use-os-pipe This switches to use an os.Pipe with all the above changes in place. |
I have generated that commit graph file, but from your patch, it seems you haven't read it? |
@zeripath After generated commit-graph file |
I'm not reading it directly - I'm relying on git reading it - the commit-graph would speed up the The main slow down in all of this code appears to be getting information out of and possibly to the git cat-file --batch pipes. Mostly this PR simply re-ordered things in an attempt to reduce the time spent filling the buffer and time spent locked in bufio.fill(...) etc. It was enough for my (quite fast) laptop but clearly not enough for yours and others. Try the os.Pipes thing - if there's any improvement it would be good to know. |
Ah I wonder if your systems are stdout buffering? |
Signed-off-by: Andrew Thornton <[email protected]>
Closing in favour of #16059 which is faster |
This PR represents a small improvement for the native git backend's get
last commit. It reduces the time taken on ports from 13s to 6.5s which is
now faster than the go-git variant.
Signed-off-by: Andrew Thornton [email protected]