-
Notifications
You must be signed in to change notification settings - Fork 427
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(core): memoize resolveInitialValueForType #7674
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
No changes to documentation |
Component Testing Report Updated Oct 29, 2024 3:50 AM (UTC) ✅ All Tests Passed -- expand for details
|
⚡️ Editor Performance ReportUpdated Tue, 29 Oct 2024 03:53:07 GMT
Detailed information🏠 Reference resultThe performance result of
🧪 Experiment resultThe performance result of this branch
📚 Glossary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, thanks @ricokahler
Have you tried this updated version in the repo with the issue?
// Collect all permission check observables | ||
toArray(), | ||
// Switch to combined observable of all permission checks | ||
switchMap((observables) => combineLatest(observables)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this did the trick! Great
@pedrobonamin I did and saw a night and day improvement! |
Description
This PR refactors the template permissions resolution to handle templates sequentially instead of in parallel. The key changes are:
combineLatest
withfrom().pipe(concatMap())
to process templates one at a timeThese changes were introduced to improve performance and reliability when resolving template permissions, particularly for large numbers of templates. The sequential processing helps prevent potential race conditions and resource contention.
What to review
Key areas to review:
templatePermissions.ts
resolve.ts
including:stableStringify
Testing
The changes are thoroughly tested through:
templatePermissions.ts
that verify sequential processingresolve.ts
covering various caching scenarios:Notes for release
Performance improvements for template permissions:
These changes should result in more predictable performance and reduced resource usage when working with templates, particularly in larger projects with many templates.