Skip to content

Commit

Permalink
Pkg: Don't spawn git processes asynchronously
Browse files Browse the repository at this point in the history
This change significantly reduces the system overhead by spawning many
git commands asynchronously. By running each git command sequentially,
this change also restores Pkg.update() functionality to Mac OS X
systems rendered unusable by JuliaLang#8601.
  • Loading branch information
jiahao committed May 6, 2015
1 parent 90f7cd0 commit ea0a3f1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions base/pkg/entry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -254,18 +254,18 @@ function update(branch::AbstractString)
end
avail = Read.available()
# this has to happen before computing free/fixed
@sync for pkg in filter!(Read.isinstalled,collect(keys(avail)))
@async Cache.prefetch(pkg, Read.url(pkg), [a.sha1 for (v,a)=avail[pkg]])
for pkg in filter!(Read.isinstalled,collect(keys(avail)))
Cache.prefetch(pkg, Read.url(pkg), [a.sha1 for (v,a)=avail[pkg]])
end
instd = Read.installed(avail)
free = Read.free(instd)
@sync for (pkg,ver) in free
@async Cache.prefetch(pkg, Read.url(pkg), [a.sha1 for (v,a)=avail[pkg]])
for (pkg,ver) in free
Cache.prefetch(pkg, Read.url(pkg), [a.sha1 for (v,a)=avail[pkg]])
end
fixed = Read.fixed(avail,instd)
@sync for (pkg,ver) in fixed
for (pkg,ver) in fixed
ispath(pkg,".git") || continue
@async begin
begin
if Git.attached(dir=pkg) && !Git.dirty(dir=pkg)
info("Updating $pkg...")
@recover begin
Expand Down

0 comments on commit ea0a3f1

Please sign in to comment.