-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
help load time regression in #33615 #33757
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
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
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
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
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 |
---|---|---|
|
@@ -141,7 +141,7 @@ julia> istaskdone(b) | |
true | ||
``` | ||
""" | ||
istaskdone(t::Task) = ((t.state == :done) | istaskfailed(t)) | ||
istaskdone(t::Task) = ((t.state === :done) | istaskfailed(t)) | ||
|
||
""" | ||
istaskstarted(t::Task) -> Bool | ||
|
@@ -182,7 +182,7 @@ julia> istaskfailed(b) | |
true | ||
``` | ||
""" | ||
istaskfailed(t::Task) = (t.state == :failed) | ||
istaskfailed(t::Task) = (t.state === :failed) | ||
|
||
Threads.threadid(t::Task) = Int(ccall(:jl_get_task_tid, Int16, (Any,), t)+1) | ||
|
||
|
@@ -390,7 +390,7 @@ function task_done_hook(t::Task) | |
|
||
if err && !handled && Threads.threadid() == 1 | ||
if isa(result, InterruptException) && isdefined(Base, :active_repl_backend) && | ||
active_repl_backend.backend_task.state == :runnable && isempty(Workqueue) && | ||
active_repl_backend.backend_task.state === :runnable && isempty(Workqueue) && | ||
active_repl_backend.in_eval | ||
throwto(active_repl_backend.backend_task, result) # this terminates the task | ||
end | ||
|
@@ -405,7 +405,7 @@ function task_done_hook(t::Task) | |
# issue #19467 | ||
if Threads.threadid() == 1 && | ||
isa(e, InterruptException) && isdefined(Base, :active_repl_backend) && | ||
active_repl_backend.backend_task.state == :runnable && isempty(Workqueue) && | ||
active_repl_backend.backend_task.state === :runnable && isempty(Workqueue) && | ||
active_repl_backend.in_eval | ||
throwto(active_repl_backend.backend_task, e) | ||
else | ||
|
@@ -482,7 +482,7 @@ function __preinit_threads__() | |
end | ||
|
||
function enq_work(t::Task) | ||
(t.state == :runnable && t.queue === nothing) || error("schedule: Task not runnable") | ||
(t.state === :runnable && t.queue === nothing) || error("schedule: Task not runnable") | ||
tid = Threads.threadid(t) | ||
# Note there are three reasons a Task might be put into a sticky queue | ||
# even if t.sticky == false: | ||
|
@@ -542,13 +542,13 @@ true | |
""" | ||
function schedule(t::Task, @nospecialize(arg); error=false) | ||
# schedule a task to be (re)started with the given value or exception | ||
t.state == :runnable || Base.error("schedule: Task not runnable") | ||
t.state === :runnable || Base.error("schedule: Task not runnable") | ||
if error | ||
t.queue === nothing || Base.list_deletefirst!(t.queue, t) | ||
t.exception = arg | ||
setfield!(t, :exception, arg) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does this help? Does somebody overwrite a setproperty that generic? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's the conversion to |
||
else | ||
t.queue === nothing || Base.error("schedule: Task not runnable") | ||
t.result = arg | ||
setfield!(t, :result, arg) | ||
end | ||
enq_work(t) | ||
return t | ||
|
@@ -624,7 +624,7 @@ end | |
function ensure_rescheduled(othertask::Task) | ||
ct = current_task() | ||
W = Workqueues[Threads.threadid()] | ||
if ct !== othertask && othertask.state == :runnable | ||
if ct !== othertask && othertask.state === :runnable | ||
# we failed to yield to othertask | ||
# return it to the head of a queue to be retried later | ||
tid = Threads.threadid(othertask) | ||
|
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
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
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.
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.
So this function isn't used now anymore? It seems somewhat unfortunate to duplicate this code in two places below just to avoid getting that extension. Maybe just
around the two function definitions?
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.
Is the point of this change just to ensure CategoricalArrays don't overload this? Just ask if that's what you want -- that's more reliable than keeping an empty definition hoping that I don't notice. :-p
Why is it a problem exactly? I understand that things like
Base.convert(::Type{T}, ::CategoricalValue{T})
are hard for the compiler, butBase.tostr_sizehint(::CategoricalString)
looks like a much more innocuous definition to me. Note that I don't care so much abouttostr_sizehint
as I care aboutconvert
(it's just a small optimization) so I'm just going to remove it.