-
Notifications
You must be signed in to change notification settings - Fork 927
perf: graduate asset-server binary search experiment to 100% #9908
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
Conversation
🦋 Changeset detectedLatest commit: 3291933 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
The improved iterative binary search implementation has been graduated from a 50% experiment to the default implementation. This provides better performance for asset manifest lookups by replacing the recursive binary search with an iterative approach. Changes: - Replace experimental logic in worker.ts with direct usage of improved implementation - Update assets-manifest.ts to use iterative binary search algorithm - Remove experimental files (assets-manifest.2.ts and its test file) - Update tests to work with new implementation signature - Add changeset documenting the performance improvement 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
87a8372
to
a7a6ad8
Compare
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.
LGTM thanks for peparing the PR.
@GregBrimble I have added the PATH_HASH_OFFSET
in:
- let entryOffset = HEADER_SIZE + entryIndex * ENTRY_SIZE;
+ let pathHashOffset = HEADER_SIZE + entryIndex * ENTRY_SIZE + PATH_HASH_OFFSET;
PATH_HASH_OFFSET === 0
so that's not a behavior change and it is covered by tests.
I added that because:
- It will help if we change the offset at some point (unlikely I guess)
- It better expresses the intent
Graduates the asset-server binary search experiment from 50% sampling to 100% usage of the improved implementation.
The iterative binary search algorithm is currently being tested at 50% sample rate to validate its performance compared to the original recursive implementation. This PR prepares the graduation to 100% usage once the experiment proves successful.
Changes
worker.ts
with direct usage of improved implementationassets-manifest.ts
to use iterative binary search algorithmassets-manifest.2.ts
and its test file)Performance Impact
The improved implementation is expected to provide better performance characteristics for asset manifest lookups, which is currently being validated through the 50% experiment rollout.
@vicb This should be merged if the 50% rollout looks good and shows improvement over the original implementation.
🤖 Generated with Claude Code