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
Improve Axis3 interactivity performance #1835
Conversation
@@ -298,7 +298,7 @@ end | |||
|
|||
Makie.step!(st) | |||
## change lengths | |||
textnode.val = push!(textnode[], L"\int_0^5x^2+2ab") |
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.
With the changes in the pr this doesn't work anymore for CairoMakie, but updating the nodes in either order normally works
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.
what does that mean?
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.
I think I made the textnode.val = ...
-> textnode[] = ...
change explicitly for CairoMakie tests to pass
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.
ah that way around...
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.
As far as I can tell, this works pretty well :) tested a few latex + text updates and Axis3 interaction
It would probably be worth testing updates to attributes like |
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.
Looks good to me although I didn't have time to run it.
Hm, f, ax, pl = scatter(1:4; axis=(xticklabelalign=(:left, :bottom),))
ax.xticklabelalign = (:right, :top) Doesn't update, but also doesn't update on last tagged version..Also, the block refactor actually broke setting it completely, but I'll make a PR to fix that. |
This is what makes updates of textsize, align, font and probably everything else that isn't position, offset or transfunc fail with |
Good old synchronization issues is why it's there... |
Didn't mean to link the second issue here lol. If tests pass the issue with updates to text attributes not propagating properly with vector positions should be fixed. |
ColorTypes.jl changed their rand implementation, which lead to this... I rebased against master and updated the ref images, so hopefully should turn green now! |
* skip unnecessary updates * use input observable * reduce update dublication * fix test * fix tests * fix test * undo some bad changes * hacky fix for GLMakie text updates * undo last change * hacky fix for text updates MakieOrg#2 * fix typos Co-authored-by: SimonDanisch <sdanisch@gmail.com>
Description
Change in text
I noticed that
Axis3
can be rather sluggish at times and one reason for it seem to be text updates. A large part of the time spent on updating the angles inAxis3
was in the update ofcamera.projectionview
. From there I intercepted the updates with timed updates with this:and found that most of the time was spend in
add_ticks_and_ticklabels!
, in (and after)label_pos_rot_valign
. (You can find that out by doing autocompletes on the functions held by the observable.)Well, long story shot - I removed the
position
trigger from text layouting and that reduced this particular timing from~0.06s
to~0.006s
. I also changed the method with(string, pos)
pairs to only update when necessary to avoid rebuilding glyphcollections too much.In Axis3
For this I tested with
src = ax.azimuth
. After the text changes the first 3 listeners took ~0.006, ~0.006 and ~0.012s. The first two aremi1
andmi2
and the last is the calculation ofprojectionview
. I changedmi1
,mi2
andmi3
to only update on changes which practically eliminates the first two calls.I also split up some observables for the axis label to avoid triggering text layouting unnecessarily. That (or the changes
text!
for latexstrings) reduced the last timing to ~0.006s for me.Type of change