⚡ Bolt: optimize list mapping and filter queries via caching and static set pre-allocation - #109
Conversation
- Pre-allocated ALL_SKILLS_SET in skills section to avoid garbage collection and set construction on empty area filter state. - Replaced inline .toLowerCase() calls on mapped loop items (areas and tools) with toLowerCaseCached() to avoid redundant string allocations. - Optimized filterable section search filter by leveraging cached lowercasing for debouncedQuery.
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Pre-allocated ALL_SKILLS_SET in skills section to avoid garbage collection and set construction on empty area filter state. - Replaced inline .toLowerCase() calls on mapped loop items (areas and tools) with toLowerCaseCached() to avoid redundant string allocations. - Optimized filterable section search filter by leveraging cached lowercasing for debouncedQuery. - Added full unit test coverage (100%) for SkillsSection, Areas, Tools, and Tags components to satisfy CI SonarCloud coverage on new code.
This pull request implements key micro-performance improvements across several frequently rendering/filtering components of Amr Abed's personal website:
ALL_SKILLS_SET = new Set(Object.keys(skillsData))in module scope insidesrc/components/sections/skills.tsxto completely avoid re-allocating and re-populating a set of all skills on every render or filter reset..toLowerCase()operations on dynamic lists ofareasandtoolswithtoLowerCaseCached()insrc/components/skills.tsx. This avoids allocating new lowercase string objects on every single render.toLowerCaseCachedhelper fordebouncedQueryinsidesrc/components/filterable-section.tsxandsrc/components/sections/skills.tsxto speed up keystroke search filtering.All tests (111 passed) and linting checks completed successfully with no regressions.
PR created automatically by Jules for task 18040809005954837218 started by @amrabed