Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit45e0925

Browse files
KristofferCKristofferCtopolarity
authored
shield_artifact_str function behind a world age barrier (#58957)
We already do this for `require` in Base loading, it probably makessense to do this here as well, as invalidating this function easily adds+1s in load time for a jll. Avoids the big load time penalty fromloading IntelOpenMP_jll in#57436 (comment).Before:```julia>@time using ModelingToolkit 6.546844 seconds (16.09 M allocations: 938.530 MiB, 11.13% gc time, 16.35% compilation time: 12% of which was recompilation)```After:```julia>@time using ModelingToolkit 5.637914 seconds (8.26 M allocations: 533.694 MiB, 11.47% gc time, 3.11% compilation time: 17% of which was recompilation)```---------Co-authored-by: KristofferC <kristoffer.carlsson@juliacomputing.com>Co-authored-by: Cody Tapscott <84105208+topolarity@users.noreply.github.com>
1 parenta58dc52 commit45e0925

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

‎stdlib/Artifacts/src/Artifacts.jl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,14 @@ function jointail(dir, tail)
543543
end
544544

545545
function_artifact_str(__module__, artifacts_toml, name, path_tail, artifact_dict, hash, platform,::Val{LazyArtifacts})where LazyArtifacts
546+
world= Base._require_world_age[]
547+
if world==typemax(UInt)
548+
world= Base.get_world_counter()
549+
end
550+
return Base.invoke_in_world(world, __artifact_str, __module__, artifacts_toml, name, path_tail, artifact_dict, hash, platform,Val(LazyArtifacts))::String
551+
end
552+
553+
function__artifact_str(__module__, artifacts_toml, name, path_tail, artifact_dict, hash, platform,::Val{LazyArtifacts})where LazyArtifacts
546554
pkg= Base.PkgId(__module__)
547555
if pkg.uuid!==nothing
548556
# Process overrides for this UUID, if we know what it is
@@ -565,7 +573,8 @@ function _artifact_str(__module__, artifacts_toml, name, path_tail, artifact_dic
565573
ifnameof(LazyArtifacts)in (:Pkg,:Artifacts,:PkgArtifacts)
566574
Base.depwarn("using Pkg instead of using LazyArtifacts is deprecated", :var"@artifact_str", force=true)
567575
end
568-
returnjointail(LazyArtifacts.ensure_artifact_installed(string(name), meta, artifacts_toml; platform), path_tail)
576+
path_base= (@invokelatest LazyArtifacts.ensure_artifact_installed(string(name), meta, artifacts_toml; platform))::String
577+
returnjointail(path_base, path_tail)
569578
end
570579
error("Artifact$(repr(name)) is a lazy artifact; package developers must call `using LazyArtifacts` in$(__module__) before using lazy artifacts.")
571580
end

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp