-
Notifications
You must be signed in to change notification settings - Fork 133
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] add memory cache to @salesforce/pwa-kit-runtime/utils/ssr-config getConfig function #1621
base: develop
Are you sure you want to change the base?
[FEATURE] add memory cache to @salesforce/pwa-kit-runtime/utils/ssr-config getConfig function #1621
Conversation
1b51d6c
to
fd30113
Compare
…onfig getConfig function SalesforceCommerceCloud#1620
fd30113
to
a68b0f0
Compare
Thanks for the contribution! Before we can merge this, we need @luca-izzo to sign the Salesforce Inc. Contributor License Agreement. |
@luca-izzo thanks for the contribution! Since you've already done the work of investigating the problem, and I'm sure you've compiled data and metrics that demonstrates the increasing latency with successive calls, I would like you to post those here as part of the PR description. Whenever I think about pull requests, I always think "Will it make sense for me looking back at this PR as a reference in 12 months from now when I've forgotten the discussion?" The data in your findings (screenshots that show an increasingly slow response time in the dev server in terminal or "network" tab in Chrome are fine) will be important to help us validate both the problem and the solution |
…onfig getConfig function SalesforceCommerceCloud#1620
Hello @bfeister, Sum of execution time of each call to getConfig in ms: Remote before: -550ms |
Note: |
Description
getConfig function inside @salesforce/pwa-kit-runtime/utils/ssr-config/ takes relatively long time to be executed on SSR and when called thousand of times can have a huge impact on the performances.
Steps to reproduce
On both remote and local environments:
Call getConfig function inside @salesforce/pwa-kit-runtime/utils/ssr-config/ a lot of times in your application and observe the impact on the rendering time.
Types of Changes
Added a Map to cache in memory the result of the function based on the provided buildDirectory.
Closes #1620