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

[perf] Call Factory::first once and cache the result in FactoryServiceProvider #361

Merged

Conversation

sunxiaoguang
Copy link
Contributor

@sunxiaoguang sunxiaoguang commented Apr 25, 2024

The boot function of FactoryServiceProvider is called multiple times as it's referenced in many views. This PR tries to cache the result and use it when processing current request. The optimization saves more than a hundred queries when opening dashboard.

Closes: #362

Signed-off-by: Xiaoguang Sun <sunxiaoguang@gmail.com>
@sunxiaoguang sunxiaoguang changed the title Call Factory::first once and cache result in FactoryServiceProvider [perf] Call Factory::first once and cache the result in FactoryServiceProvider Apr 25, 2024
@SMEWebify SMEWebify added the Reduce technical debt Facilitates long-term thinking label Apr 25, 2024
@SMEWebify SMEWebify added this to In progress in v1.09 - Pieris ergane via automation Apr 25, 2024
@SMEWebify SMEWebify merged commit 45ac897 into SMEWebify:WEM-2.0 Apr 25, 2024
1 check passed
v1.09 - Pieris ergane automation moved this from In progress to Done Apr 25, 2024
sunxiaoguang added a commit to sunxiaoguang/WebErpMesv2 that referenced this pull request Apr 28, 2024
An optimization in SMEWebify#361 caused composer install fail without working
database configuration.

Signed-off-by: Xiaoguang Sun <sunxiaoguang@gmail.com>
SMEWebify added a commit that referenced this pull request Apr 28, 2024
@SMEWebify SMEWebify moved this from Done to Integrated in v1.09 - Pieris ergane Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reduce technical debt Facilitates long-term thinking
Projects
No open projects
v1.09 - Pieris ergane
Integrated on demo site
Development

Successfully merging this pull request may close these issues.

Loading dashboard is slow when MySQL server is running in a remote site.
2 participants