-
-
Notifications
You must be signed in to change notification settings - Fork 767
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
PR 4071 resulted ~100ms perf regression (time to first idle) #4419
Comments
Thanks for the input @zhangyiatmicrosoft! Bettom line, we need a better way to test performace impact before we ship a version and not afterwards, otherwise you'll get stuck with trying to fix perfromance issues after we release a version... |
TBH in every codebase, we struggle on how to "gate" the perf of each PR, because it is way too tricky and affected by so many factors at runtime, on top of the difficulties to statistically measure it. We need continue to seek for solutions for sure; meanwhile this request is not a complaint, just asking guidance and help to dissect the changes in PR 4071. THANKS! |
Can you clarify how we can help then? |
Can you maybe produce/provide a (minimal?) style which triggers a strong performance degradation? That could help narrow it down i also noticed the slowdown |
Hi @zhangyiatmicrosoft I think the most impactful change in the PR in terms of ops per symbol is in Maybe a fast path can be added for the most common type of symbols? I would assume the default to be the most common, which is |
@kubapelc thanks for the tip. We found that the said the above roughly accounted for 50% of the hit. Is there anything else? |
Hi @zhangyiatmicrosoft looking at the diffs and profiler data now, sadly I don't know where else to look. It seems that What exactly did you measure to find the 50% figure? Have you implemented the fast path for common symbols? |
@kubapelc I have not implemented anything; just simply commented out _projectCollisionBox and did profiling test --- it won't render properly of course, but it is the first step. After comparing (1) before PR4071, (2) after 4071, and (3) 4071 with above changes, looks like (3) performed halfway between the first two. |
I'll probably get around to it next week. Globe branch definitely has this as well, and I also noticed other potential perf problems in its symbol changes. Globe will definitely have much worse time to first idle though, due to extra processing needed per tile, but only when globe projection is enabled. |
@zhangyiatmicrosoft since we have a hard time seeing the performance issues, I would advise you to take a more active approach in solving them. |
In an effort to upgrade from MapLibre 4.1.2 to 4.3.2, while measuring time to first idle we observed roughly 100ms (or 2%) perf regression at 90 percentile.
After extensive search and experiments, we narrowed it down to PR 4071: #4071
The above data were based on 3 million user hits on Bing maps over the period of 14 days.
maplibre-gl-js version: 4.3.2
browser: edge/chrome/ff/safari
Tile to first idle is affected by many factors such as the tiles, styles and individual CPU/GPU, that is probably why benchmark testing in MapLibre was not able to catch.
We have eliminated at least two factors:
This PR is quite sophisticated. Many changes we do not understand and need help. Specifically, while the goal is to fix bugs related to variable-anchors and collision boxes, can it maintain the same performance when the above two conditions do not apply?
@kubapelc would you please help review how many more ops were added per symbol, and give some suggestions regarding how to cut them down as much as possible?
Thanks a lot!
The text was updated successfully, but these errors were encountered: