Skip to content
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

[PERFOMANCE] Slowdown caused by new type-computation in 1.6 #3276

Closed
jebej opened this issue Feb 7, 2021 · 0 comments · Fixed by JuliaPlots/RecipesPipeline.jl#78 or #3277
Closed
Labels

Comments

@jebej
Copy link
Contributor

jebej commented Feb 7, 2021

Ref: JuliaLang/julia#39509

The new short-form type computation in 1.6 slows down the computation of the user recipe signature here:

https://github.com/JuliaPlots/RecipesPipeline.jl/blob/c251015a5420818229cdfd284c0802a7db19085c/src/utils.jl#L232-L234

As a fix, it looks as if this string computation is only made to potentially display a warning in warn_on_recipe_aliases!:

function RecipesPipeline.warn_on_recipe_aliases!(
plt::Plot,
plotattributes::AKW,
recipe_type,
signature_string
)
for k in keys(plotattributes)
if !is_default_attribute(k)
dk = get(_keyAliases, k, k)
if k !== dk
@warn "Attribute alias `$k` detected in the $recipe_type recipe defined for the signature $signature_string. To ensure expected behavior it is recommended to use the default attribute `$dk`."
end
plotattributes[dk] = RecipesPipeline.pop_kw!(plotattributes, k)
end
end
end

If instead the string is computed only if the warning is determined to appear, this slowdown should go away. This would probably also lead to a small speedup on 1.5 and earlier since the userrecipe_signature_string also shows up on the 1.5 profile in the issue above.

As far as I can tell, this would require changing 4 calls to warn_on_recipe_aliases! in RecipesPipeline by passing the argument directly, instead of stringifying first:
https://github.com/JuliaPlots/RecipesPipeline.jl/search?q=warn_on_recipe_aliases%21

@jebej jebej added the bug label Feb 7, 2021
@jebej jebej changed the title [BUG] Slowdown caused by new type-computation in 1.6 [PERFOMANCE] Slowdown caused by new type-computation in 1.6 Feb 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant