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

feat(gatsby): cache/memoize hot functions in runAPI #29240

Merged
merged 2 commits into from
Jan 28, 2021
Merged

feat(gatsby): cache/memoize hot functions in runAPI #29240

merged 2 commits into from
Jan 28, 2021

Conversation

KyleAMathews
Copy link
Contributor

@KyleAMathews KyleAMathews commented Jan 27, 2021

Reduces overhead to invoking APIs by ~40%.

Real-world impact seems around 10-20% for sourcing/transforming data.

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jan 27, 2021
@KyleAMathews KyleAMathews added topic: scaling builds and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jan 27, 2021
const publicPath = getPublicPath({ ...config, ...program }, ``)

if (typeof publicPath === `undefined`) {
publicPath = getPublicPath({ ...config, ...program }, ``)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

skip redundant copying of data

...(restrictedActionsAvailableInAPI[api] || {}),

let availableActions
if (availableActionsCache.has(api)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

skip redundant copying of data

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