-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
FEATURE: Speed up UI flow queries with custom queries #3817
base: 8.4
Are you sure you want to change the base?
Conversation
Have to rebase, something is off with all those changes |
Also have to check whether I broke the "presets" feature of the document tree |
After discussing this a bit with @mhsdesign, it can make sense to add a "findNodesByIdentifiers" to the NodeDataRepository for 8.4 and use the new method instead of adding queries in this PR. This could also be useful for Neos 9. I will open an issue and link it. |
Currently translated at 100.0% (121 of 121 strings) Translation: Neos/Neos.Ui - Main - 8.3 Translate-URL: https://hosted.weblate.org/projects/neos/neos-ui-main-8-3/nl/
Currently translated at 100.0% (121 of 121 strings) Translation: Neos/Neos.Ui - Main - 8.3 Translate-URL: https://hosted.weblate.org/projects/neos/neos-ui-main-8-3/es/
…nodedata With this change the minimal required nodedata for each node in the rendered content is inserted as data attribute and not as inline script anymore. This improves performance as no extra function call is executed for each node. Additonally the reduction in rendered node attributes reduces the output filesize and again improves loading time. To prevent just-in-time loading of nodes all incomplete nodedata is requested after the guest frame has finished loading.
Co-authored-by: Marc Henry Schultz <[email protected]>
…r guest frame The content tree is loaded early and can load fully loaded nodes without being slower as the response time is the same. But this way we can skip lots of nodes from being loaded by the guest frame if they are already present in the store.
The UI filters itself, so the two children queries with different nodetypefilters have no effect on the final outcome and are just slowing down the response.
This way the followup methods that add the childnodes to the resulting noderesults can directly read the children from the 1st level cache. The speedup is ~50% (1s -> 500ms) in my tests for 175 nodes.
This way we only need one query to get all requested nodes instead of a query for each one.
cde3bab
to
a9b14b2
Compare
Needs a rebase when #3770 was unmerged into 8.4 |
What I did
This is a follow up for #3770 in which we load all nodes requested by the UI directly from the database instead of querying each node by itself and its document and content children separately.
How I did it
Extract some methods from the NodeDataRepository and added them to the NodeService in the UI to resolve all requested nodes with one db query and prefetch all child nodes of the resulting nodes to fill them into the 1st-level cache.
How to verify it
Flow query performance for loading a large page in a large project with the page tree, content tree and nodes required for the displayed content. The page tree requests 175 nodes (the 332KB request), the content tree requests 58 nodes ( the 129kb request) and the guest frame requests 191 nodes (the 615kb request) which haven't been loaded by the content tree yet and with the duplicates removed.
Performance UI 8.3.8:
![neosui-83-838](https://private-user-images.githubusercontent.com/596967/343097382-1ac97b58-b979-4d11-b939-c66c0bcc7e2d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU3MjMzNzgsIm5iZiI6MTcyNTcyMzA3OCwicGF0aCI6Ii81OTY5NjcvMzQzMDk3MzgyLTFhYzk3YjU4LWI5NzktNGQxMS1iOTM5LWM2NmMwYmNjN2UyZC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwOTA3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDkwN1QxNTMxMThaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kNDMyM2QwZDM3YWUzYTYyOTE0MTVhYjJkYWNhMDczODM2MTkzZWU5M2E4M2M4MGMwODI2YjZjZTU1MzQzYTA0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.hNWfimKYKqIDAQzJYLgfUpPafVSXx2cth0xfnoB_UXc)
Performance with branch #3770:
![neosui-83-remove-ui-script-tag](https://private-user-images.githubusercontent.com/596967/343097399-84164e0c-14de-4954-927c-ce70d4de04ea.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU3MjMzNzgsIm5iZiI6MTcyNTcyMzA3OCwicGF0aCI6Ii81OTY5NjcvMzQzMDk3Mzk5LTg0MTY0ZTBjLTE0ZGUtNDk1NC05MjdjLWNlNzBkNGRlMDRlYS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwOTA3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDkwN1QxNTMxMThaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iNzIwMjZmYWNiMmY5MGVlNDczMGRjNzY1OGY0NTQ5ZTQ0ZTdlNTQzY2FjNjY2NGMxYWMwMTlmMjlkYjA5OWEwJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.zfqeHSJEM1szFWKLFzFzcMFTdbfeKCnc6N_2Nh4GrUE)
Performance with this branch:
![neosui-83-optimise-ui-flowqueries](https://private-user-images.githubusercontent.com/596967/343097393-f4047e0a-466e-4f9b-b6a8-93b76a1ac7e7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU3MjMzNzgsIm5iZiI6MTcyNTcyMzA3OCwicGF0aCI6Ii81OTY5NjcvMzQzMDk3MzkzLWY0MDQ3ZTBhLTQ2NmUtNGY5Yi1iNmE4LTkzYjc2YTFhYzdlNy5wbmc_WC1BbXotQWxnb3JpdGh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