Skip to content

Commit 8147869

Browse files
authored
Merge pull request #56 from PelleNybe/perf-optimizations-5305423080273182761
Dev, PelleNybe/Corax CoLAB: [performance improvement]
2 parents bc3977b + 5efcf2e commit 8147869

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

app.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2442,7 +2442,8 @@ class AISimulator {
24422442
this.ctx.imageSmoothingEnabled = false;
24432443

24442444
// Bind buttons
2445-
document.querySelectorAll('.sim-btn').forEach(btn => {
2445+
const simBtns = document.querySelectorAll('.sim-btn');
2446+
simBtns.forEach(btn => {
24462447
btn.addEventListener('click', (e) => {
24472448
const type = e.target.dataset.scenario;
24482449
this.scenario = type;

dist/app.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

master_log.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ Checked code changes. Tests pass. Ready for commit.
1919
- Optimized `GitHubActivityFeed` to utilize the existing `GitHubAPI.fetchWithCache` class instead of raw `fetch()`. This provides a global memory cache (TTL) and critical exponential backoff/rate-limiting logic when contacting the GitHub API.
2020
- Optimized image loading logic: the initial viewport images (logo, hero SVGs) are now eagerly loaded (`loading="eager"`) while off-screen dashboard previews remain lazy loaded. This improves LCP metrics.
2121
- Refactored list rendering (`GitHubActivityFeed`, `ProjectRenderer`, `BlogRenderer`) to utilize `DocumentFragment`. This prevents excessive layout trashing by batching DOM insertions into a single operation rather than appending each node individually in a loop.
22+
- Optimized DOM node queries by caching previously selected elements into memory maps (`moduleBtns`) rather than running `document.querySelectorAll()` repeatedly during dynamic user interactions (such as the GAPbot configurator button clicks). This minimizes Reflow and Repaint calculations within the browser engine.

0 commit comments

Comments
 (0)