Repository navigation
Conversation
…ecking, and parallelize build IO - Move htmlEntities out of escapeHtml to prevent recreating object on every match - Avoid Object.keys().sort().join() in postMessage handler to reduce intermediate string and array allocations - Parallelize writing generated static site assets in build.mjs with Promise.all() - Add rendering benchmark test file to prevent regressions Co-authored-by: teddashh <233386770+teddashh@users.noreply.github.com>
|
👋 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. |
This PR implements a performance pass across the repository focusing on memory allocation reduction, optimizing redundant operations, and identifying build process bottlenecks.
Changes include:
escapeHtmloptimization: The HTML entities mapping object has been lifted out of the.replacecallback inscripts/build.mjs, ensuring a new object isn't created for every matched character during sanitization.site.jsobject check optimization: The postMessageevent.datachecking logic was refactored to replace an expensive sorting and string joining check (Object.keys().sort().join()) with a fastObject.keys().lengthand series of booleaninchecks. This saves multiple array/string allocations on every user click action or window resize message.build()generation pipeline inscripts/build.mjsto execute file reads and writes concurrently usingPromise.all(), mitigating latency.tests/benchmark.test.mjsto profilerenderWorkspaceoperations in a tight loop to protect performance against future regressions.Testing:
npm run buildand resolving allnpm testand Playwright tests (npm run test:browser) completely and cleanly with 0 failing suites.PR created automatically by Jules for task 32287853566871743 started by @teddashh