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

Possibility of reducing some file checks during precompilation of jll files #44

Open
KristofferC opened this issue Sep 13, 2022 · 0 comments

Comments

@KristofferC
Copy link
Member

Every jll package does the following checks during precompile time

statx(AT_FDCWD, "/home/kc/.julia/packages/GR_jll/k8I6U/src/wrappers/JuliaArtifacts.toml"  ENOENT (No such file or directory)
statx(AT_FDCWD, "/home/kc/.julia/packages/GR_jll/k8I6U/src/wrappers/Artifacts.toml"  ENOENT (No such file or directory)
statx(AT_FDCWD, "/home/kc/.julia/packages/GR_jll/k8I6U/src/wrappers/JuliaProject.toml"  ENOENT (No such file or directory)
statx(AT_FDCWD, "/home/kc/.julia/packages/GR_jll/k8I6U/src/wrappers/Project.toml"  ENOENT (No such file or directory)
statx(AT_FDCWD, "/home/kc/.julia/packages/GR_jll/k8I6U/src/JuliaArtifacts.toml"  ENOENT (No such file or directory)
statx(AT_FDCWD, "/home/kc/.julia/packages/GR_jll/k8I6U/src/Artifacts.toml"  ENOENT (No such file or directory)
statx(AT_FDCWD, "/home/kc/.julia/packages/GR_jll/k8I6U/src/JuliaProject.toml"  ENOENT (No such file or directory)
statx(AT_FDCWD, "/home/kc/.julia/packages/GR_jll/k8I6U/src/Project.toml"  ENOENT (No such file or directory)
statx(AT_FDCWD, "/home/kc/.julia/packages/GR_jll/k8I6U/JuliaArtifacts.toml"  ENOENT (No such file or directory)
statx(AT_FDCWD, "/home/kc/.julia/packages/GR_jll/k8I6U/Artifacts.toml", 

Now, stat is pretty cheap on linux/windows but there have been reports about it being quite slow on Windows (JuliaLang/julia#40570).

Since we know the exact layout of a jll package, it should be no need to have to look through the filesystem for the Artifact file.

@staticfloat believes these lookups come from

$(Expr(:macrocall, Symbol("@artifact_str"), __source__, src_name, :(host_platform)))
else
# We explicitly use `macrocall` here so that we can manually pass the `__source__`
# argument, to avoid `@artifact_str` trying to lookup `Artifacts.toml` here.
return $(Expr(:macrocall, Symbol("@artifact_str"), __source__, src_name))
(which is then calling https://github.com/JuliaLang/julia/blob/70bfa3fe09cd127f4a84bcb9b4709102477d8d30/stdlib/Artifacts/src/Artifacts.jl#L490-L509 at precompile time).

Instead of generating a call to @artifact_str, perhaps we can just look up the path from the artifact file which we know where it lives?

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

1 participant