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: generator performance optimization work #380

Merged
merged 3 commits into from
Sep 9, 2024
Merged

Conversation

guybedford
Copy link
Member

This implements multiple and significant performance optimizations for the generator:

  • Fetch pooling for browsers to avoid overloading the fetch API
  • Increasing fetch retries from 3 to 5
  • Ensuring fetch retries apply not only to the initial fetch call but also to the streaming of the response
  • Coalescing all fetch calls consistently through the codebase to ensure there are never duplicate network requests in-flight. This is done carefully across both the trace map and provider implementations. In the process, the getTraceEntry method was refactored into the resolver implementation to share the cache with the exists call
  • Optimizing the multi-pass visitation algorithm to remove the old looping convergence code - all installs are now simply two pass - trace + construct import map
  • Optimizing the multi-install case when installing an array of install, so that phases are batched between all installs removing run-away looping behaviour for multi-installs

A test is added for a very large install case that didn't work at all when this work was started and now completes in 20 seconds.

@guybedford guybedford merged commit db9571c into main Sep 9, 2024
6 checks passed
@guybedford guybedford deleted the perf-fixes branch September 9, 2024 02:06
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

Successfully merging this pull request may close these issues.

1 participant