Skip to content

⚡ Bolt: Hoist search predicate string transformation in Launcher - #43

Closed
schmug wants to merge 1 commit into
mainfrom
jules/bolt-optimize-launcher-search-7163933051281773504
Closed

schmug wants to merge 1 commit into
mainfrom
jules/bolt-optimize-launcher-search-7163933051281773504

Conversation

@schmug

@schmug schmug commented Apr 20, 2026

Copy link
Copy Markdown
Owner

💡 What: Added _searchable to the AppManifest, pre-populated during boot or statically. Updated Launcher to run query.toLowerCase() once outside the useMemo filter array.

🎯 Why: When mapping or filtering long lists on keydown events, calling .toLowerCase() on the query and concatenating a string per-element causes unnecessary object allocations and GC pressure on the main thread for every keystroke.

📊 Impact: Expected to reduce O(N) string allocations per keystroke in the app launcher (where N is total apps), leading to slightly reduced GC stutter.

🔬 Measurement: Verify tests pass via npm run test and linting works via npm run lint. Ensure behavior remains identical.


PR created automatically by Jules for task 7163933051281773504 started by @schmug

By pre-lowercasing the `_searchable` identifier string directly onto the
`AppManifest` on boot, and hoisting the query text's `.toLowerCase()` pass
outside of the `.filter()` loop, we avoid O(N) object allocations / garbage
generation on every user keystroke.

Co-authored-by: schmug <38227427+schmug@users.noreply.github.com>
@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.

@schmug

schmug commented Apr 25, 2026

Copy link
Copy Markdown
Owner Author

Closing without merge — the Launcher filters ~15 apps, and lowercasing that many short strings per keystroke is microseconds. There's no measured perf issue at this scale.

The proposed change also adds a leaky abstraction (a _searchable field on the public AppManifest type, plus an isLowercased flag on matches()) and creates a second place — alongside the mobile tile-count assertion — that has to stay in sync when apps are added. Per CLAUDE.md: "Don't add features, refactor, or introduce abstractions beyond what the task requires."

If the Launcher ever needs to handle 1000+ apps, the right move is a Map-based index, not annotating the manifest type.

@schmug schmug closed this Apr 25, 2026
@schmug
schmug deleted the jules/bolt-optimize-launcher-search-7163933051281773504 branch April 25, 2026 17:50
@google-labs-jules

Copy link
Copy Markdown
Contributor

Closing without merge — the Launcher filters ~15 apps, and lowercasing that many short strings per keystroke is microseconds. There's no measured perf issue at this scale.

The proposed change also adds a leaky abstraction (a _searchable field on the public AppManifest type, plus an isLowercased flag on matches()) and creates a second place — alongside the mobile tile-count assertion — that has to stay in sync when apps are added. Per CLAUDE.md: "Don't add features, refactor, or introduce abstractions beyond what the task requires."

If the Launcher ever needs to handle 1000+ apps, the right move is a Map-based index, not annotating the manifest type.

Understood. Acknowledging that this work is now obsolete and stopping work on this task. I will avoid premature optimizations for small lists in the future.

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