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

Performance issues on large menus, model loaded via repository #341

Open
ilnytskyi opened this issue Sep 3, 2024 · 1 comment
Open

Performance issues on large menus, model loaded via repository #341

ilnytskyi opened this issue Sep 3, 2024 · 1 comment

Comments

@ilnytskyi
Copy link

Hello,

We noticed that for bigger menus the GraphQL response is too slow.
After some investigation we found that this method https://github.com/SnowdogApps/magento2-menu/blob/develop/Model/GraphQl/Resolver/DataProvider/Node/TypeModel.php#L49 loads whole model via its repository, and later only uses it to get UrlKey.
See https://github.com/SnowdogApps/magento2-menu/blob/develop/Model/GraphQl/Resolver/DataProvider/Node/TypeModel.php#L68

Selection_20240903_012
Selection_20240903_013

That would be great improvement if we could only load one or a few needed attributes like magento does on product listing with collection (there is option to specify if attribute should be loaded on listing).
So the MenuEntityLoader can be introduced with posibility to specify what attributes to load;
url_key can be set as default, in case anyone would need more data form the model, they would implement custom loaders, so default menu implementation would not affect the performance.

@andrzejborkowski
Copy link

@ilnytskyi thank you for reporting the issue, I created an internal ticket SMM-18 and our dev team will take a look at that soon. However, it will much faster if you can create a PR with the mentioned improvements and then we can review your code and include to one of the next releases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants