Skip to content
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

Installation is 'slow' #850

Open
maleadt opened this issue Feb 27, 2024 · 2 comments
Open

Installation is 'slow' #850

maleadt opened this issue Feb 27, 2024 · 2 comments

Comments

@maleadt
Copy link
Member

maleadt commented Feb 27, 2024

Now that there's support for nightlies, I see juliaup downloading updates much more than before, which has led me to realize that the process is relatively slow:

❯ time juliaup add nightly
Installing Julia latest-linux-x86_64
juliaup add nightly  2.90s user 2.36s system 25% cpu 20.490 total

vs.

❯ time wget https://julialangnightlies-s3.julialang.org/bin/linux/x86_64/julia-latest-linux-x86_64.tar.gz -O - | tar -xzf - -C $HOME
2024-02-27 13:59:40 (25.9 MB/s) - written to stdout [245088202/245088202]

wget  -O -  0.72s user 0.21s system 10% cpu 9.214 total
tar -xzf - -C $HOME  4.70s user 2.09s system 73% cpu 9.218 total

This is of course a minor issue, 20 seconds isn't terrible, but it's curious that it's twice as slow as wget + tar.

I'm using the official released version of juliaup. When working on the nightly support, I was using a debug build which was even slower, so maybe this is simply a matter of missing compiler optimizations?

@KristofferC
Copy link
Sponsor Member

Here is some sort of profile:

image

Maybe

fn unpack_sans_parent<R, P>(mut archive: Archive<R>, dst: P, levels_to_skip: usize) -> Result<()>
where
R: Read,
P: AsRef<Path>,
{
for entry in archive.entries()? {
let mut entry = entry?;
let path: PathBuf = entry
.path()?
.components()
.skip(levels_to_skip) // strip top-level directory
.filter(|c| matches!(c, Normal(_))) // prevent traversal attacks TODO We should actually abort if we come across a non-standard path element
.collect();
entry.unpack(dst.as_ref().join(path))?;
}
Ok(())
}
is slow?

@maleadt
Copy link
Member Author

maleadt commented Feb 27, 2024

Interesting; I was just collecting flamegraphs too:

juliaup
wget_tar_gzip

Here it seems like much more time is spent writing data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants