-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
stop specializing on argument types of display
#28616
Merged
Merged
Conversation
This file contains 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
there is no real advantage in specializing on the argument types for display since it goes through a quite complicated machinery of trying to find applicable displays. Before: julia> let @time precompile(Tuple{typeof(Base.Multimedia.display), Int32}) @time precompile(Tuple{typeof(Base.Multimedia.display), Vector{Int}}) @time precompile(Tuple{typeof(Base.Multimedia.display), Float64}) @time precompile(Tuple{typeof(Base.Multimedia.display), Symbol}) end 0.034542 seconds (37.08 k allocations: 1.916 MiB) 0.042272 seconds (92.57 k allocations: 4.810 MiB) 0.039003 seconds (90.20 k allocations: 4.758 MiB) 0.030826 seconds (61.08 k allocations: 3.066 MiB) After: julia> let @time precompile(Tuple{typeof(Base.Multimedia.display), Int32}) @time precompile(Tuple{typeof(Base.Multimedia.display), Vector{Int}}) @time precompile(Tuple{typeof(Base.Multimedia.display), Float64}) @time precompile(Tuple{typeof(Base.Multimedia.display), Symbol}) end 0.000041 seconds (12 allocations: 640 bytes) 0.000029 seconds (10 allocations: 544 bytes) 0.000024 seconds (9 allocations: 496 bytes) 0.000021 seconds (9 allocations: 496 bytes)
JeffBezanson
approved these changes
Aug 13, 2018
KristofferC
added a commit
that referenced
this pull request
Aug 19, 2018
there is no real advantage in specializing on the argument types for display since it goes through a quite complicated machinery of trying to find applicable displays. Before: julia> let @time precompile(Tuple{typeof(Base.Multimedia.display), Int32}) @time precompile(Tuple{typeof(Base.Multimedia.display), Vector{Int}}) @time precompile(Tuple{typeof(Base.Multimedia.display), Float64}) @time precompile(Tuple{typeof(Base.Multimedia.display), Symbol}) end 0.034542 seconds (37.08 k allocations: 1.916 MiB) 0.042272 seconds (92.57 k allocations: 4.810 MiB) 0.039003 seconds (90.20 k allocations: 4.758 MiB) 0.030826 seconds (61.08 k allocations: 3.066 MiB) After: julia> let @time precompile(Tuple{typeof(Base.Multimedia.display), Int32}) @time precompile(Tuple{typeof(Base.Multimedia.display), Vector{Int}}) @time precompile(Tuple{typeof(Base.Multimedia.display), Float64}) @time precompile(Tuple{typeof(Base.Multimedia.display), Symbol}) end 0.000041 seconds (12 allocations: 640 bytes) 0.000029 seconds (10 allocations: 544 bytes) 0.000024 seconds (9 allocations: 496 bytes) 0.000021 seconds (9 allocations: 496 bytes) (cherry picked from commit eabb601)
KristofferC
added a commit
that referenced
this pull request
Aug 19, 2018
there is no real advantage in specializing on the argument types for display since it goes through a quite complicated machinery of trying to find applicable displays. Before: julia> let @time precompile(Tuple{typeof(Base.Multimedia.display), Int32}) @time precompile(Tuple{typeof(Base.Multimedia.display), Vector{Int}}) @time precompile(Tuple{typeof(Base.Multimedia.display), Float64}) @time precompile(Tuple{typeof(Base.Multimedia.display), Symbol}) end 0.034542 seconds (37.08 k allocations: 1.916 MiB) 0.042272 seconds (92.57 k allocations: 4.810 MiB) 0.039003 seconds (90.20 k allocations: 4.758 MiB) 0.030826 seconds (61.08 k allocations: 3.066 MiB) After: julia> let @time precompile(Tuple{typeof(Base.Multimedia.display), Int32}) @time precompile(Tuple{typeof(Base.Multimedia.display), Vector{Int}}) @time precompile(Tuple{typeof(Base.Multimedia.display), Float64}) @time precompile(Tuple{typeof(Base.Multimedia.display), Symbol}) end 0.000041 seconds (12 allocations: 640 bytes) 0.000029 seconds (10 allocations: 544 bytes) 0.000024 seconds (9 allocations: 496 bytes) 0.000021 seconds (9 allocations: 496 bytes) (cherry picked from commit eabb601)
Merged
KristofferC
added a commit
that referenced
this pull request
Aug 19, 2018
there is no real advantage in specializing on the argument types for display since it goes through a quite complicated machinery of trying to find applicable displays. Before: julia> let @time precompile(Tuple{typeof(Base.Multimedia.display), Int32}) @time precompile(Tuple{typeof(Base.Multimedia.display), Vector{Int}}) @time precompile(Tuple{typeof(Base.Multimedia.display), Float64}) @time precompile(Tuple{typeof(Base.Multimedia.display), Symbol}) end 0.034542 seconds (37.08 k allocations: 1.916 MiB) 0.042272 seconds (92.57 k allocations: 4.810 MiB) 0.039003 seconds (90.20 k allocations: 4.758 MiB) 0.030826 seconds (61.08 k allocations: 3.066 MiB) After: julia> let @time precompile(Tuple{typeof(Base.Multimedia.display), Int32}) @time precompile(Tuple{typeof(Base.Multimedia.display), Vector{Int}}) @time precompile(Tuple{typeof(Base.Multimedia.display), Float64}) @time precompile(Tuple{typeof(Base.Multimedia.display), Symbol}) end 0.000041 seconds (12 allocations: 640 bytes) 0.000029 seconds (10 allocations: 544 bytes) 0.000024 seconds (9 allocations: 496 bytes) 0.000021 seconds (9 allocations: 496 bytes) (cherry picked from commit eabb601)
KristofferC
added a commit
that referenced
this pull request
Sep 8, 2018
there is no real advantage in specializing on the argument types for display since it goes through a quite complicated machinery of trying to find applicable displays. Before: julia> let @time precompile(Tuple{typeof(Base.Multimedia.display), Int32}) @time precompile(Tuple{typeof(Base.Multimedia.display), Vector{Int}}) @time precompile(Tuple{typeof(Base.Multimedia.display), Float64}) @time precompile(Tuple{typeof(Base.Multimedia.display), Symbol}) end 0.034542 seconds (37.08 k allocations: 1.916 MiB) 0.042272 seconds (92.57 k allocations: 4.810 MiB) 0.039003 seconds (90.20 k allocations: 4.758 MiB) 0.030826 seconds (61.08 k allocations: 3.066 MiB) After: julia> let @time precompile(Tuple{typeof(Base.Multimedia.display), Int32}) @time precompile(Tuple{typeof(Base.Multimedia.display), Vector{Int}}) @time precompile(Tuple{typeof(Base.Multimedia.display), Float64}) @time precompile(Tuple{typeof(Base.Multimedia.display), Symbol}) end 0.000041 seconds (12 allocations: 640 bytes) 0.000029 seconds (10 allocations: 544 bytes) 0.000024 seconds (9 allocations: 496 bytes) 0.000021 seconds (9 allocations: 496 bytes) (cherry picked from commit eabb601)
KristofferC
added a commit
that referenced
this pull request
Sep 8, 2018
there is no real advantage in specializing on the argument types for display since it goes through a quite complicated machinery of trying to find applicable displays. Before: julia> let @time precompile(Tuple{typeof(Base.Multimedia.display), Int32}) @time precompile(Tuple{typeof(Base.Multimedia.display), Vector{Int}}) @time precompile(Tuple{typeof(Base.Multimedia.display), Float64}) @time precompile(Tuple{typeof(Base.Multimedia.display), Symbol}) end 0.034542 seconds (37.08 k allocations: 1.916 MiB) 0.042272 seconds (92.57 k allocations: 4.810 MiB) 0.039003 seconds (90.20 k allocations: 4.758 MiB) 0.030826 seconds (61.08 k allocations: 3.066 MiB) After: julia> let @time precompile(Tuple{typeof(Base.Multimedia.display), Int32}) @time precompile(Tuple{typeof(Base.Multimedia.display), Vector{Int}}) @time precompile(Tuple{typeof(Base.Multimedia.display), Float64}) @time precompile(Tuple{typeof(Base.Multimedia.display), Symbol}) end 0.000041 seconds (12 allocations: 640 bytes) 0.000029 seconds (10 allocations: 544 bytes) 0.000024 seconds (9 allocations: 496 bytes) 0.000021 seconds (9 allocations: 496 bytes) (cherry picked from commit eabb601)
KristofferC
added a commit
that referenced
this pull request
Feb 11, 2019
there is no real advantage in specializing on the argument types for display since it goes through a quite complicated machinery of trying to find applicable displays. Before: julia> let @time precompile(Tuple{typeof(Base.Multimedia.display), Int32}) @time precompile(Tuple{typeof(Base.Multimedia.display), Vector{Int}}) @time precompile(Tuple{typeof(Base.Multimedia.display), Float64}) @time precompile(Tuple{typeof(Base.Multimedia.display), Symbol}) end 0.034542 seconds (37.08 k allocations: 1.916 MiB) 0.042272 seconds (92.57 k allocations: 4.810 MiB) 0.039003 seconds (90.20 k allocations: 4.758 MiB) 0.030826 seconds (61.08 k allocations: 3.066 MiB) After: julia> let @time precompile(Tuple{typeof(Base.Multimedia.display), Int32}) @time precompile(Tuple{typeof(Base.Multimedia.display), Vector{Int}}) @time precompile(Tuple{typeof(Base.Multimedia.display), Float64}) @time precompile(Tuple{typeof(Base.Multimedia.display), Symbol}) end 0.000041 seconds (12 allocations: 640 bytes) 0.000029 seconds (10 allocations: 544 bytes) 0.000024 seconds (9 allocations: 496 bytes) 0.000021 seconds (9 allocations: 496 bytes) (cherry picked from commit eabb601)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 is no real advantage in specializing on the argument types for display since it goes through a quite complicated machinery of trying to find applicable displays anyway. This function is getting compiled for every type we show in the REPL for example.
Before:
After: