Skip to content

⚡ Bolt: [performance improvement] Precompute valid coins Set for API#381

Draft
yeboster wants to merge 1 commit into
mainfrom
bolt/perf-api-valid-coins-set-14677475422724281215
Draft

⚡ Bolt: [performance improvement] Precompute valid coins Set for API#381
yeboster wants to merge 1 commit into
mainfrom
bolt/perf-api-valid-coins-set-14677475422724281215

Conversation

@yeboster

Copy link
Copy Markdown
Contributor

💡 What: The optimization moves the mapping of validCoins (metaNamesSdk.config.byoc.map) outside of the GET request handler in src/routes/api/register/[name]/fees/[coin]/+server.ts and converts the resulting array into a Set.
🎯 Why: Previously, the API would evaluate the static configuration array, allocate a new mapped array, and run an O(N) .includes() linear scan on every single incoming GET request. This was unnecessary overhead for static configurations.
📊 Impact: Changes the inclusion check from O(N) to O(1) and eliminates redundant mapping computations on every API request.
🔬 Measurement: Verified via standard unit tests and local Git diff inspection to ensure it resolves safely in constant time.


PR created automatically by Jules for task 14677475422724281215 started by @yeboster

Moves the mapping of valid coins outside of the GET request handler
and converts the array into a Set. This changes an O(N) lookup into
an O(1) lookup on every single incoming API request.

Co-authored-by: yeboster <[email protected]>
@vercel

vercel Bot commented Jun 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
app Error Error Jun 28, 2026 7:50pm

@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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