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
RFC: Speed up Pkg.update() #11137
RFC: Speed up Pkg.update() #11137
Conversation
@@ -58,6 +58,10 @@ attached(; dir="") = success(`symbolic-ref -q HEAD`, dir=dir) | |||
branch(; dir="") = readchomp(`rev-parse --symbolic-full-name --abbrev-ref HEAD`, dir=dir) | |||
head(; dir="") = readchomp(`rev-parse HEAD`, dir=dir) | |||
|
|||
function iscommit(sha1s::Array{ASCIIString}; dir="") | |||
indexin(sha1s,split(readchomp(`log --all --format=%H`, dir=dir),"\n")).!=0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check whether the latest versions of git, 2.3, 2.4 etc still accept --format
? The docs for recent versions are a bit ambiguous.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--format
still works for me on 2.4.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, 2.4.0 seems to behave the same way as the older version I've been using.
+1 – good approach if this works for all various versions of git |
…) and using it in Cache.prefetch().
I made some minor cleanups and rebased. I removed the unnecessary |
RFC: Speed up Pkg.update()
nominating for potential backport, unless there are objections |
backported in a946283 |
I get a major speed improvement in
Pkg.update()
with this patch. The idea is to usegit log --all
to extract all valid hashes instead of callinggit
on every single hash. This can be used inCache.prefetch()
, which currently makes multiple passes through every version of every installed package.It would probably be good to get some independent testing before merging.
Should improve #9944 somewhat, will eventually be superceded by #7584 (libgit2).