-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[qt] Performance degradation with v1.2.0 #10644
Comments
Hi @rinigus - thanks for the feedback. Is this still the case using the latest version of |
Hi @brunoabinader, I will look into it a bit later. I plan to check against master branch, make working example and then we can look together on whether its fixed in the latest version. There are couple other issues that I have to fix first in my bindings for QML, but then I'll work on it. As for timeline, its probably 1-2 weeks I may need before working on this performance problem. |
Started looking into it. Current master has the same issue. To demonstrate the problem, I patched demo app to add moving source (Press 4 to activate) that has changing label. As it is visible in example, every update leads to blinking of the label (label is taken down and later redrawn slowly). By changing the timer period (10 ms, for example), one can get to the state where label is mostly invisible. This patch (not clean, no wish to merge) is available https://github.com/rinigus/mapbox-gl-native/tree/issue_10644_blinky at with the corresponding commit rinigus@247a5a4 I'll try to find where this issue started by checking older commits. |
I have been bisecting to find the commit. Turned out to be rather non-trivial since several commits didn't compile, unfortunately. Bisecting log with the last check done manually (couldn't fix the compilation issue in few minutes that I had):
This leaves the following commits responsible for blinky symbols on update (git bisect visualize):
Looks like the commits are coming from #10436 And the search was interrupted by failing to compile c0cb210 |
@brunoabinader and @jfirebaugh: please let me know if additional information is needed. As it is, I have found the PR which is responsible for blinking symbols on update of the source (#10436 by @ChrisLoer), but couldn't go down to a single commit. This issue is a blocker for us since we are getting blinking on current position on every update. So, navigation applications have "here" symbol blinking once per second or so disturbing the users. As a result, I am holding off updates to v1.2.0 of qt stack and we are still using v1.1.0 |
Hi @rinigus this sounds like issue #10559 which we should have fixed in PR #10899, except that PR went into I'll try to build your demo app to see if I can reproduce and get a better understanding of what's going on. /cc @ansis |
@ChrisLoer , I also had hopes for that fix, but it didn't really work for me. I do wonder whether this blinking is visible on Qt only. Thank you very much for looking into it. |
@rinigus I can reproduce locally using your branch. I suspect it's something specific to how we use gl-native in Qt, but I'm not very familiar with our Qt build so I'm still getting oriented. |
Hi @rinigus I'm sorry I wasn't thinking clearly -- this is actually expected behavior now that we do collision detection between multiple sources (one of the main features introduced with #10436). When you update the position of the feature, it won't start showing until we've run collision detection and determined that there's space for it (at which point it starts fading in). However, we can display the symbol immediately without any fading if we know ahead of time it won't collide with anything. In your demo, you can add:
Notice in the example this will still cause the moving label to knock out the labels below it (you can control this separately with Hopefully this will restore the functionality you need, but it will still be a little different from the previous behavior: before, if two symbols within the same source collided, you could knock one out without interrupting the animation. Now, to do a smooth animation of a symbol with updating positions, you need to allow it to overlap with every other symbol. We're looking into ways to add more granularity to this behavior in the future. |
Hi @ChrisLoer , great idea, I'll test it tonight. I did try to use |
@ChrisLoer, just tested against master and using Thank you very much, I am closing the issue and it can be added as one more resolved issue to the list of #10899 |
Hi!
I have updated from 1.1.0 to 1.2.0 and observed significant slowdown in drawing additional layers on top of the map:
when drawing point source with the label showing its
{name}
(tested on Linux PC)when drawing point source with assigned image (tested on Sailfish OS phone)
Here, the point source is defined as GeoJSON object, has
name
property and point coordinates. The program is updating the name and coordinate every specifieddt
to make the point move and its name change accordingly together with the movement.Used setup: Qt bindings as released via qt-staging, version v1.2.0; qmapboxgl exposed via QML plugin https://github.com/rinigus/mapbox-gl-qml.
Label:
It looks like every time when I change the label of the point source by updating it, the old text disappears first and then is drawn. The process can take ~0.5s on desktop. Its all looking nice for slow updates with the labels around removed in the case of collision, but such speed is not sufficient when the label is updated more frequently. For example, if I update the label every 50ms, I don't see it at all. In v1.1.0, I did not observe any on/off flickering when changing the label. As a result, the text was floating (or jumping depending on
dt
) without disappearing.Image:
When point source is shown using an image (symbol with image source), every time I update the coordinates, it seems to remove the image and add it later leading to blinking of the image. This has been observed in full-blown map application and maybe there is something else going on than just update of coordinates. I may have to check on simpler example. However, such behavior was not observed with v1.1.0
Specific conversions and QMapboxGL calls:
Corresponding point definition (https://github.com/rinigus/mapbox-gl-qml/blob/master/app/qml/main.qml#L191) and update (https://github.com/rinigus/mapbox-gl-qml/blob/master/app/qml/main.qml#L395) are implemented in QML. The update is translated to C++ via
map->updateSource
at https://github.com/rinigus/mapbox-gl-qml/blob/master/src/qmapboxsync.cpp#L36 after conversion at https://github.com/rinigus/mapbox-gl-qml/blob/master/src/qquickitemmapboxgl.cpp#L533.Not sure whether these issues have been reported already.
The text was updated successfully, but these errors were encountered: