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

PB-259: Improve startup performance by rendering menu section only when the map is rendered #663

Merged
merged 3 commits into from
Feb 28, 2024

Conversation

ltshb
Copy link
Contributor

@ltshb ltshb commented Feb 27, 2024

The rendering of catalogue is very costly and store events would re-trigger it
therefore wait that the map has been rendered before rendering the catalogue,
it is anyway not visible at startup until the user click on the menu entry.
It still needs to be always rendered once the application has been started, otherwise
the toggling of the menu would be too slow.

Also differ the rendering and opening of the active layers for the same reason
and also because if the menu contains external layer (e.g. kml, gpx, ...) the
application needs to load its metadata/data before rendering the correct name
in the list. For kml and GPX it would use at startup the default KML or GPX
name until the name has been loading. By defering the active layers list
we avoid having the name changing.

Several other options has been tried but they did not improve the performances:

  • using shallow ref on the layer catalogue, but this had no impact. Shallow ref is not easy to use on store content, the store content needs to be anyway added as computed value in order to use shallow ref. This might be better and more efficient to use with pinia store.
  • using new events instead of the mapIsReady, see PB-259: Improve startup performance by postponing the topic tree rendering #661

Test link

Copy link

cypress bot commented Feb 27, 2024

Passing run #758 ↗︎

0 168 21 0 Flakiness 0

Details:

PB-259: Improved logging of the router store subscriber
Project: web-mapviewer Commit: 53c43f1768
Status: Passed Duration: 04:41 💡
Started: Feb 28, 2024 6:10 AM Ended: Feb 28, 2024 6:15 AM

Review all test suite changes for PR #663 ↗︎

…active layer rendering

The rendering of catalogue is very costly and store events would re-trigger it
therefore wait that the map has been rendered before rendering the catalogue,
it is anyway not visible at startup until the user click on the menu entry.
It still needs to be always rendered once the application has been started, otherwise
the toggling of the menu would be too slow.

Also differ the rendering and opening of the active layers for the same reason
and also because if the menu contains external layer (e.g. kml, gpx, ...) the
application needs to load its metadata/data before rendering the correct name
in the list. For kml and GPX it would use at startup the default KML or GPX
name until the name has been loading. By defering the active layers list
we avoid having the name changing.
The drawing test `keeps the kml after a page reload, ...` was flaky and failed
due to a race condition. This test has been improved to avoid race condition.

Other tests using the cy.reload() have been also slightly improve by waiting
the mapIsReady before continuing avoiding race condition.
@ltshb ltshb force-pushed the feat-PB-259-performance-menu-off branch from 1a856a9 to 4af0246 Compare February 28, 2024 05:54
@ltshb ltshb changed the title PB-259: Performance menu on map rendered PB-259: Improve startup performance by rendering menu section only when the map is rendered Feb 28, 2024
@ltshb ltshb marked this pull request as ready for review February 28, 2024 06:02
Do not log for non watched mutation because this is missleading in the logs.

There is already anther global mutation watcher that logs all mutations.
Comment on lines +259 to +261
Cypress.Commands.add('waitMapIsReady', ({ timeout = 15000 } = {}) => {
cy.waitUntilState((state) => state.app.isMapReady, { timeout: timeout })
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might make sense to use this in the ubiquitous .goToMapView command, don't you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is already Part of it

@ltshb ltshb merged commit 9b19966 into develop Feb 28, 2024
6 checks passed
@ltshb ltshb deleted the feat-PB-259-performance-menu-off branch February 28, 2024 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants