Skip to content

⚙️ Engine: Edge Memory & O(1) Column Lookup Optimizations - #1554

Closed
alehar9320 wants to merge 1 commit into
mainfrom
engine/visit-stats-whats-new-optimizations-10207674792449958570
Closed

alehar9320 wants to merge 1 commit into
mainfrom
engine/visit-stats-whats-new-optimizations-10207674792449958570

Conversation

@alehar9320

Copy link
Copy Markdown
Owner

Implemented edge runtime memory and performance optimizations across src/utils/visit-stats.ts and src/utils/whats-new-glance.ts:

  1. Module-level Intl.DateTimeFormat Hoisting: Hoisted FIRST_SEEN_FORMATTER to module-level scope in visit-stats.ts to prevent repeated ICU locale initialization and GC allocation churn on edge Worker requests.
  2. O(1) Column Map Indexing: Pre-constructed an indexed columnMap: Map<string, number> in parseVisitGlance when parsing array-structured result rows, converting $O(N)$ linear indexOf lookups per row field into $O(1)$ Map lookups.
  3. Zero-Allocation Direct Bullet Iteration & Regex Guard: Direct iteration over splitReleaseBody bullets in whats-new-glance.ts eliminates intermediate { raw, title } object and per-release array mappings, while skipping duplicate regex tests when raw === visitorTitle.
  4. Unit Test Expansion & Journaling: Added/updated Vitest unit tests in src/__tests__/whats-new-glance.test.ts and src/utils/visit-stats.test.ts and updated .Jules/engine.md.

PR created automatically by Jules for task 10207674792449958570 started by @alehar9320

- Hoisted Intl.DateTimeFormat (FIRST_SEEN_FORMATTER) to module-level scope in src/utils/visit-stats.ts to eliminate repeated ICU locale initialization on Cloudflare Workers edge runtimes.
- Pre-constructed columnMap Map<string, number> in parseVisitGlance to convert O(N) Array.prototype.indexOf lookups per row field into O(1) Map lookups.
- Refactored collectItems and isKeptVisitorLine in src/utils/whats-new-glance.ts to iterate directly over splitReleaseBody bullets, avoiding intermediate { raw, title } object allocations and redundant regex matching when raw === visitorTitle.
- Updated and expanded Vitest test coverage across src/__tests__/whats-new-glance.test.ts and src/utils/visit-stats.test.ts.
- Updated Engine journal in .Jules/engine.md.

Co-authored-by: alehar9320 <5390430+alehar9320@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.

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@alehar9320
alehar9320 temporarily deployed to engine/visit-stats-whats-new-optimizations-10207674792449958570 - astro-cloudflare-personal-website-web-service PR #1554 October 4, 2026 02:11 — with Render Destroyed
@cloudflare-workers-and-pages

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
🔵 In progress
View logs
me 49f2210 Oct 04 2026, 02:11 AM

@coderabbitai

coderabbitai Bot commented Oct 4, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4fbd824f-be59-4521-99a5-0b5eec4284b1
📥 Commits

Reviewing files that changed from the base of the PR and between 9ff88fc and 49f2210.

📒 Files selected for processing (6)
  • .Jules/engine.md
  • src/__tests__/whats-new-glance.test.ts
  • src/utils/visit-stats.test.ts
  • src/utils/visit-stats.ts
  • src/utils/whats-new-glance.ts
  • worker-configuration.d.ts
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@alehar9320-bot

Copy link
Copy Markdown
Collaborator

@jules HARD ABORT — close unmerged. Do not restack.

Owner decision: this is Jules Engine micro-opt farm for @alehar9320 (Intl hoist + O(1) columnMap + glance bullet iteration), same class as closed #1553 / #1538 / #1460 / #1414 and siblings overlapping Dual CLOSE HOLD #1204 tip 854866c7.

  • Tip 49f2210b FULL 49f2210b4b3873d19a4b1839f84c22598c4205bb
  • Files: .Jules/engine.md (backdated 2025-06-18) + visit-stats.ts (FIRST_SEEN_FORMATTER + columnMap) + whats-new-glance.ts + test renames + worker-configuration.d.ts noise
  • No visitor-facing brand value; micro-opts do not belong on main for this personal branding site
  • Draft convert skipped (Jules-for-alehar9320)
  • Do not reopen, restack, or re-open as Bolt/Engine/Vantage with the same tip class

Closing unmerged now. No Bolt/Engine onto main. Overlay 69ca717. Hire LinkedIn. Stay off #800. Live 9ff88fc1. Bot only.

@codecov

codecov Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.00000% with 8 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/utils/whats-new-glance.ts 75.00% 0 Missing and 7 partials ⚠️
src/utils/visit-stats.ts 95.45% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@codecov

codecov Bot commented Oct 4, 2026

Copy link
Copy Markdown

Bundle Report

Changes will decrease total bundle size by 562.07kB (-48.89%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
molecular-mars-esm 587.7kB -562.07kB (-48.89%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: molecular-mars-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
_astro/page.Dfh37nub.js (New) 331.33kB 331.33kB 100.0% 🚀
_astro/module.hBldxaOw.js (New) 240.43kB 240.43kB 100.0% 🚀
_astro/Chat.astro_astro_type_script_index_0_lang.C74O8NpS.js (New) 11.15kB 11.15kB 100.0% 🚀
_astro/PostHog.astro_astro_type_script_index_0_lang.CwWDfW8B.js (New) 2.17kB 2.17kB 100.0% 🚀
_astro/hire-analytics.DN2Rut5L.js (New) 1.37kB 1.37kB 100.0% 🚀
_astro/BaseLayout.astro_astro_type_script_index_0_lang.-eMcgRY-.js (New) 690 bytes 690 bytes 100.0% 🚀
_astro/contact.astro_astro_type_script_index_0_lang.Bosb3NKF.js (New) 554 bytes 554 bytes 100.0% 🚀
chunks/whats-new_BankhB0t.mjs (Deleted) -280.3kB 0 bytes -100.0% 🗑️
chunks/default-handler_DqHG8eeJ.mjs (Deleted) -192.27kB 0 bytes -100.0% 🗑️
chunks/traceData_Dr_fxZBz.mjs (Deleted) -126.65kB 0 bytes -100.0% 🗑️
chunks/schemas_Cot3sONg.mjs (Deleted) -126.52kB 0 bytes -100.0% 🗑️
chunks/server_2oEWh56Y.mjs (Deleted) -105.31kB 0 bytes -100.0% 🗑️
chunks/assets_lTcd8Z19.mjs (Deleted) -57.34kB 0 bytes -100.0% 🗑️
chunks/sequence_CaMmmLod.mjs (Deleted) -47.7kB 0 bytes -100.0% 🗑️
_astro/whats-new.Bf7CHJhQ.css (Deleted) -43.09kB 0 bytes -100.0% 🗑️
chunks/shorthash_CUWuunCX.mjs (Deleted) -29.34kB 0 bytes -100.0% 🗑️
chunks/image-binding-transform_Cf-85Vgs.mjs (Deleted) -24.19kB 0 bytes -100.0% 🗑️
chunks/_astro_data-layer-content_BvrnG9KS.mjs (Deleted) -19.62kB 0 bytes -100.0% 🗑️
virtual_astro_middleware.mjs (Deleted) -15.63kB 0 bytes -100.0% 🗑️
chunks/parse_Ba8fytvn.mjs (Deleted) -15.01kB 0 bytes -100.0% 🗑️
chunks/chat_zD7YyXHs.mjs (Deleted) -12.01kB 0 bytes -100.0% 🗑️
chunks/visits_CH9uXrqX.mjs (Deleted) -8.18kB 0 bytes -100.0% 🗑️
chunks/visitor-changelog_BxY0qWCV.mjs (Deleted) -6.98kB 0 bytes -100.0% 🗑️
chunks/github-releases_BV2_eBm_.mjs (Deleted) -6.7kB 0 bytes -100.0% 🗑️
entry.mjs (Deleted) -5.7kB 0 bytes -100.0% 🗑️
chunks/release-summary_38ArvXd3.mjs (Deleted) -4.97kB 0 bytes -100.0% 🗑️
chunks/release-summary_CjrmKGpt.mjs (Deleted) -4.91kB 0 bytes -100.0% 🗑️
chunks/_virtual_astro_session-driver__DuTqh8b.mjs (Deleted) -3.47kB 0 bytes -100.0% 🗑️
chunks/static-image-collection_BCOQ0UCH.mjs (Deleted) -2.85kB 0 bytes -100.0% 🗑️
chunks/releases_BfVji4Vx.mjs (Deleted) -2.19kB 0 bytes -100.0% 🗑️
chunks/image-transform-endpoint_iHq_WzOS.mjs (Deleted) -1.83kB 0 bytes -100.0% 🗑️
chunks/compiler_CI7zcT-L.mjs (Deleted) -1.77kB 0 bytes -100.0% 🗑️
chunks/consts_J54VxCWf.mjs (Deleted) -1.12kB 0 bytes -100.0% 🗑️
chunks/image-service-workerd_DAtwUGVM.mjs (Deleted) -960 bytes 0 bytes -100.0% 🗑️
chunks/rolldown-runtime_CsW08brr.mjs (Deleted) -941 bytes 0 bytes -100.0% 🗑️
chunks/_virtual_astro_server-island-manifest_ms-rvHw7.mjs (Deleted) -798 bytes 0 bytes -100.0% 🗑️
chunks/content-assets_CKY12EWb.mjs (Deleted) -732 bytes 0 bytes -100.0% 🗑️
chunks/noop-entrypoint_BWurWioB.mjs (Deleted) -680 bytes 0 bytes -100.0% 🗑️

@alehar9320-bot

Copy link
Copy Markdown
Collaborator

HARD ABORT FULL — closing unmerged.

@jules this is a Jules farm restack of the Engine Edge Memory / O(1) column-lookup / glance-allocation class (#1538 / #1524 / #1510 / #1498 / #1474 / #1462 / #1425 + Bolt sibling #1553 closed tonight), overlapping Dual CLOSE HOLD #1204 tip 854866c7.

Files match the farm pattern: .Jules/engine.md (backdated 2025-06-18) + src/utils/visit-stats.ts (FIRST_SEEN_FORMATTER hoist + columnMap) + whats-new-glance.ts (collectItems / isKeptVisitorLine alloc micro-opts) + tests + worker-configuration.d.ts churn.

No visitor or employer-marketing value — same en-GB Stockholm first-seen format, same glance filter outcomes, no proof, hire, overlay, chat, or UI chrome change. Micro-alloc claim stays speculative on rare glance paths. Do not land on main.

Do not reopen as Jules. Do not Jules-restack. No Engine onto main for this farm. Soft dims N/A. Overlay 69ca717. Hire LinkedIn. Stay off #800. Live 9ff88fc1. Bot only.

Johan UX — tip 49f2210b FULL 49f2210b4b3873d19a4b1839f84c22598c4205bb

This branch was successfully deployed

No deployments
engine/visit-stats-whats-new-optimizations-10207674792449958570 - astro-cloudflare-personal-website-web-service PR #1554 — 49f2210b Deployed Oct 4, 2026 by alehar9320
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.

2 participants