-
-
Notifications
You must be signed in to change notification settings - Fork 15
Use latestworld-if-toplevel
#60
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
name = "PrecompileTools" | ||
uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" | ||
version = "1.3.1" | ||
version = "1.3.2" | ||
authors = ["Tim Holy <[email protected]>", "t-bltg <[email protected]>", "and contributors"] | ||
|
||
[deps] | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
name = "NotPrecompiled" | ||
uuid = "82bf3039-9474-4881-94bd-824dbad9b14d" | ||
version = "0.1.0" | ||
authors = ["Tim Holy <[email protected]>"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module NotPrecompiled | ||
|
||
# This module can be a dependency of others to check | ||
# caching: call `call_isa_bool(x::T)` for some `T` and | ||
# then check for `isa_bool(::T)` specializations. | ||
|
||
isa_bool(x) = isa(x, Bool) | ||
call_isa_bool(x) = isa_bool(Base.inferencebarrier(x)) | ||
|
||
const themethod = only(methods(isa_bool)) | ||
|
||
end # module NotPrecompiled |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# This file is machine-generated - editing it directly is not advised | ||
|
||
julia_version = "1.12.0-beta1" | ||
manifest_format = "2.0" | ||
project_hash = "e8122786ed34aaf26503bdeb405954ce2c258c3a" | ||
|
||
[[deps.Dates]] | ||
deps = ["Printf"] | ||
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" | ||
version = "1.11.0" | ||
|
||
[[deps.NotPrecompiled]] | ||
path = "../NotPrecompiled" | ||
uuid = "82bf3039-9474-4881-94bd-824dbad9b14d" | ||
version = "0.1.0" | ||
|
||
[[deps.NotToplevel]] | ||
deps = ["PrecompileTools"] | ||
path = "." | ||
uuid = "3879f6fb-0a74-4dcf-89ef-07d77fe6cb90" | ||
version = "0.1.0" | ||
|
||
[[deps.PrecompileTools]] | ||
deps = ["Preferences"] | ||
path = "../.." | ||
uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" | ||
version = "1.3.1" | ||
|
||
[[deps.Preferences]] | ||
deps = ["TOML"] | ||
git-tree-sha1 = "9306f6085165d270f7e3db02af26a400d580f5c6" | ||
uuid = "21216c6a-2e73-6563-6e65-726566657250" | ||
version = "1.4.3" | ||
|
||
[[deps.Printf]] | ||
deps = ["Unicode"] | ||
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" | ||
version = "1.11.0" | ||
|
||
[[deps.TOML]] | ||
deps = ["Dates"] | ||
uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" | ||
version = "1.0.3" | ||
|
||
[[deps.Unicode]] | ||
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" | ||
version = "1.11.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
name = "NotToplevel" | ||
uuid = "3879f6fb-0a74-4dcf-89ef-07d77fe6cb90" | ||
version = "0.1.0" | ||
authors = ["Tim Holy <[email protected]>"] | ||
|
||
[deps] | ||
NotPrecompiled = "82bf3039-9474-4881-94bd-824dbad9b14d" | ||
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module NotToplevel | ||
|
||
using NotPrecompiled | ||
using PrecompileTools: @setup_workload, @compile_workload | ||
|
||
hello(who::AbstractString) = "Hello, $who" | ||
|
||
NotPrecompiled.call_isa_bool(1.0) | ||
|
||
@setup_workload begin | ||
withenv() do | ||
@compile_workload begin | ||
hello("x") | ||
NotPrecompiled.call_isa_bool('x') | ||
end | ||
end | ||
end | ||
|
||
end # module NotToplevel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mortenpi @benlorenz note that the pattern used in your reports blocks effective precompilation. If you haven't followed, here's the issue: if you compile external (outside of the package, e.g., Base or whatever) code before you reach
@compile_workload
, it will not be cached. The problem is that your construct forces compilation of the anonymous function before@compile_workload
turns on. Thus, any code not "owned" by your package that can't be inferrably traced back to a caller in your package will be dropped from the precompile cache.As a guide to understanding the test, know that
Base.inferencebarrier
is used inNotPrecompiled
to force runtime dispatch, so that theisa_bool
specializations cannot be traced back toNotToplevel
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also CC @jpthiele