Skip to content

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

@KristofferC

Description

@KristofferC

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions