-
Notifications
You must be signed in to change notification settings - Fork 14
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
Poor performance using one(T) inside Polyester.@batch loop #116
Comments
It's because of Julia's not-specializing-on-type heuristics. You could make a PR that has the macro call wrap all arguments to struct WrapType{T} end
wrap_type(@nospecialize(x)) = x
wrap_type(::Type{T}) where {T} = WrapType{T}()
unwrap_type(@nospecialize(x)) = x
unwrap_type(::WrapType{T}) where {T} = T This lets you work around this particular one of Julia's performance-killing heuristics. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am running Julia 1.9 with two threads. If I include
one(T)
inside aPolyester.@batch
loop, whereT
is a type known to the function, I obtain slow performance with a lot of allocations. Consider the following exampleThis gives me
The text was updated successfully, but these errors were encountered: