Skip to content

perf: speed up web startup and add progress - #125

Merged
njzjz merged 18 commits into
njzjz:masterfrom
njzjz-bot:agent/faster-web-progress
Aug 16, 2026
Merged

perf: speed up web startup and add progress#125
njzjz merged 18 commits into
njzjz:masterfrom
njzjz-bot:agent/faster-web-progress

Conversation

@njzjz-bot

@njzjz-bot njzjz-bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • stop loading Pyodide twice by removing the unused main-thread runtime
  • stop downloading the unused sqlite3 Pyodide package
  • preconnect to PyPI hosts used during cold start
  • expose Worker initialization/query phases to the page
  • show a 0–100% progress bar and disable duplicate submissions while a query is running
  • add web unit tests, Chromium end-to-end coverage, and Codecov reporting

Why

The web app was paying most of its cold-start cost before the actual literature lookup: Pyodide was loaded once in the page and again in the Worker, then the Worker loaded an unused sqlite3 package. The query code itself is already asynchronous/concurrent for DOI sources, so startup is the largest straightforward optimization.

Progress stages

The Worker now reports runtime loading, package installer loading, wenxian installation, query preparation, literature-source lookup, and completion. The page renders these as an accessible progress bar rather than a static Fetching... message.

Web validation

The required test workflow now has a dedicated Web tests job. It runs nine Node-based browser/worker tests under c8, uploads coverage/lcov.info to Codecov with the web flag, and then launches a real headless Chromium against a local copy of docs/.

Current web coverage:

  • overall lines/statements: 99.01%
  • wenxian.js: 100%
  • webworker.js: 100%
  • pyworker.js: 95.55%

The Chromium smoke test performs a real DOI query for 10.1063/5.0155600, including Pyodide initialization, PyPI package loading, progress rendering, literature lookup, and BibTeX output validation. Python coverage is now explicitly uploaded with the separate python flag.

Agent: ChatGPT
Model: GPT-5.6 Sol

Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
@codecov

codecov Bot commented Aug 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.22222% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.31%. Comparing base (4fc6177) to head (967e23e).

Files with missing lines Patch % Lines
docs/pyworker.js 91.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #125      +/-   ##
==========================================
+ Coverage   94.53%   95.31%   +0.78%     
==========================================
  Files          15       18       +3     
  Lines         969     1173     +204     
==========================================
+ Hits          916     1118     +202     
- Misses         53       55       +2     
Flag Coverage Δ
python 94.53% <ø> (?)
web 99.01% <97.22%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@njzjz
njzjz marked this pull request as ready for review August 16, 2026 15:15
Copilot AI lite review requested due to automatic review settings August 16, 2026 15:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

njzjz-bot and others added 8 commits August 16, 2026 23:17
Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
@njzjz
njzjz merged commit 5ccb215 into njzjz:master Aug 16, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants