Skip to content
This repository was archived by the owner on May 17, 2025. It is now read-only.

perf: generator performance optimization work - #380

Merged
guybedford merged 3 commits into
mainfrom
perf-fixes
Sep 9, 2024
Merged

perf: generator performance optimization work#380
guybedford merged 3 commits into
mainfrom
perf-fixes

Conversation

@guybedford

Copy link
Copy Markdown
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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant