-
Notifications
You must be signed in to change notification settings - Fork 150
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
nospecialize in displaying SOneTo #1198
Conversation
For some weird reason this makes printing slower? julia> @time repr(SOneTo(3))
0.002636 seconds (20 allocations: 1.133 KiB, 99.22% compilation time)
"SOneTo(3)"
julia> @time repr(SOneTo(4))
0.004234 seconds (20 allocations: 1.133 KiB, 99.47% compilation time)
"SOneTo(4)"
julia> function Base.show(io::IO, @nospecialize(x::SOneTo))
print(io, "SOneTo(", length(x)::Int, ")")
end
julia> @time repr(SOneTo(3))
0.007384 seconds (1.04 k allocations: 71.046 KiB, 99.67% compilation time)
"SOneTo(3)"
julia> @time repr(SOneTo(4))
0.000025 seconds (7 allocations: 344 bytes)
"SOneTo(4)"
|
I'd say that this PR improves things, as the compilation happens only once, and subsequent calls are fast. Perhaps the first run is slowed down by the In case this matters, the first call may be precompiled using |
Gentle bump |
#1187 is now merged so I think we could add printing of |
I'm unsure what's the best way to address this, as |
8b5c622
to
0bdce73
Compare
I think you should redirect stdout, not stdin. Like this: redirect_stdout(devnull) do
show(SOneTo(1))
end in the workload. |
Thanks for catching that! Oddly, adding this doesn't improve the compilation time. I wonder if this is because the display to |
I see. Well, let's merge this then without precompilation. |
No description provided.