Skip to content

perf: reduce package size and input/asset overhead - #64

Open
ZenAlexa wants to merge 11 commits into
darrenprx:mainfrom
ZenAlexa:contrib/performance-package-runtime
Open

ZenAlexa wants to merge 11 commits into
darrenprx:mainfrom
ZenAlexa:contrib/performance-package-runtime

Conversation

@ZenAlexa

@ZenAlexa ZenAlexa commented Oct 13, 2026 •

Copy link
Copy Markdown

What and why

Reduce package size and repeated work along the input-to-overlay path. The contribution covers packaging, native output, helper configuration, overlay resource lifetimes, and asset loading on current main.

  • Coalesce adjacent moves for the same wheel before serialization and read the 11 relevant modifier states. Preserve control-message ordering, including room text and panel events.
  • Deduplicate unchanged helper configurations, retain restart state, and discard late input from retired subprocesses. Cancel timers for removed pings, field outlines, and replaced toasts. Release the room's per-peer ping, transfer, and ballot budgets on leave.
  • Use body-free HEAD probes for bundled emote assets. Keep GET delivery and custom-emote cache behavior intact.
  • Keep lossless FLAC ping sounds, production bundle minification, English and Chinese Electron resources, and UDBZ disk images. Extraction, asset pruning, app, site, and prototype consumers use the same sounds.

Current Linux support, signed room messages, room text and voting, and kept pings remain in place. Existing native and application behavior scenarios cover the restored runtime changes; CI is configured to run the packaged scenario for Windows, macOS, and Linux.

Validation

November 1 visible-mark lifetime update

revision 901a8120f842 gives visible pings and field outlines one expiry owner. explicit clear, fade completion, and capacity eviction remove the element and cancel its pending expiry together. the existing delayed-glow queue retains ownership of outlines that have not appeared. kept marks preserve their caller-owned lifetime.

bundled the complete current overlay source and exercised it in Chromium 156 with an injected IPC boundary, real DOM and timers, and served repository assets. at baseline f4786b75d8af, 100 unkept teammate ping/clear cycles left 100 expiry timers after the elements disappeared; clearing 20 displayed field outlines left 20 expiry timers. the current revision leaves zero in both cases.

the current browser scenarios also passed mixed ping/outline clear and fade, capacity eviction of outlines by a ping burst, repeated removal after clear, replacement preservation, cancellation of a delayed outline before a later outline appears, and normal expiry. the 1,000-ping burst retained 60 visible pings and 60 expiry timers, then reached zero. the packaged scenario now covers mixed clear/fade and outline eviction, and its final empty-state check waits for the existing idle-notification timer to settle.

native helper verification passed 692 helper checks, 533 context checks and 26 macOS callback checks, plus the output-queue and modifier scenarios. all 12 current FLAC files decode to the same s16le PCM bytes as current main's WAV files using FFmpeg. TypeScript syntax parsing passed for the changed source and scenario files. full dependency-aware type checks, the complete TypeScript suite, native Electron/packaged-ASAR execution and physical input/audio checks have not been repeated for this revision.

The preceding integration f4786b75d8af includes main c97fe77, including the 0.6.0 teammate feature. Kept the new context helper, its native tests, the MCP/teammate build entries, PDF resources and upstream dependency versions alongside this PR's output/decision scenarios, asset handling and packaging settings. Updated the output scenario's four ready-message expectations to the current helper protocol version 6; the old expectation reproduced the integration failure before this update.

Current integration checks on macOS arm64:

  • npm run typecheck passed.
  • npm test passed 2,045 tests across 129 files; 5 tests were skipped.
  • npm run test:helper passed 692 helper checks, 533 context checks and 26 macOS callback checks. The output scenario passed backpressure, message boundaries, capacity, shutdown and writer-failure cases. The modifier scenario passed 2,048 held-key combinations and 28,672 toggle checks.
  • npm run build completed for main, preload and all renderer entries, including the new teammate surface.
  • Whitespace checks passed. The context test build retained 10 missing-field-initializer warnings from the upstream fixtures.

Dependencies were installed from the current lockfile with --include=dev; the shell's NODE_ENV=production initially omitted the development types. The current integration has not repeated the desktop input/audio scenarios, installer/packaged-ASAR checks or size/latency measurements. The results below remain tied to their earlier revisions.

Earlier validation

Integrated main efa3fe63 in 3e02f797 on 2026-10-23. The upright cyan On My Way texture, extraction rule and existing regression are retained. The design table combines that upstream texture with this contribution's FLAC sounds.

On macOS arm64 with Node 22.23.4 and Electron 44.5.1:

  • Typecheck passed. Native verification passed 542 helper checks, 20 macOS callback checks, the output-queue scenarios and 28,672 modifier checks.
  • Existing TypeScript suite: 66 files, 1,052 passed, one platform-specific test skipped.
  • App and demo-site builds passed. The real Electron lifecycle scenario passed settings persistence, helper restart and buffered-toggle ordering, retired output, 1,000 signed room lifecycles and two production overlays. Each overlay decoded 56 sounds; 176 HEAD probes had empty bodies. Each burst retained 60 pings, one toast and 61 expiry timers, then reached zero.
  • The blocked-writer workload emitted five protocol lines with zero drops. The modifier and output binaries also passed a separate rerun. Decoding the 12 current FLAC files and main's WAV files to PCM produced identical bytes; encoded audio totals remain 1,185,626 and 3,745,302 bytes.

The macOS disk image, signature verification, packaged-ASAR scenarios, 44.1/48 kHz Web Audio comparison and sanitizers reported at b7aa225a and earlier revisions were not repeated for this merge. This round used built development assets and left system permissions and the existing user profile unchanged.

Please run the Windows and Linux CI jobs and verify physical input/audio and installer/upgrade behavior on the supported platforms. Those checks remain outside the current local run.

Checklist

  • Repeat typecheck and the complete TypeScript suite on the current revision; native checks passed in this round.
  • Repeat desktop input/audio and packaged-resource checks on the current integration; earlier results retain their recorded revisions.
  • User-facing strings are unchanged; both README command tables are updated.
  • Design and extraction instructions describe the FLAC assets; scenario documentation covers runtime validation.
  • Repeat visual inspection after the 0.6.0 integration; this PR retains the existing appearance of its affected controls.

Keep the latest adjacent move for each wheel and preserve control-message
boundaries. Format typed events on the output thread. Add a blocked-consumer
scenario covering ordering, overflow, shutdown and writer replacement.
Minify production bundles, retain English and Chinese Electron resources,
and use UDBZ compression for the macOS disk image. Preserve HEAD through
the app protocol so overlay asset probes receive headers only.

Exercise production overlays and custom-emote lifecycles against packaged
ASAR files in both platform jobs. Build and retain the Windows installer
alongside the existing macOS artifact.
Create temporary application data before launching Electron and select it
before the ready event so scenario storage remains isolated.
Merge current main and keep the contribution within packaging and asset
storage. Preserve input, overlay, room, and CI behavior from main.

Store ping sounds as lossless FLAC, retain their extraction and consumers,
minify production bundles, and restrict packaged locales to English and
Chinese. Retain the independent Web Audio comparison scenario.
@ZenAlexa ZenAlexa changed the title Reduce package size and input/asset overhead perf: reduce packaged bundle and audio size Oct 17, 2026
@ZenAlexa
ZenAlexa marked this pull request as ready for review October 17, 2026 05:44
Copilot AI balanced review requested due to automatic review settings October 17, 2026 05:44

Copilot AI left a comment

Copy link
Copy Markdown

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.

Restore the queue, modifier, helper configuration, resource-lifetime and
asset-probe changes alongside the packaged asset optimizations. Preserve
current Linux, room protocol, room controls, and kept-ping behavior.

Exercise the current signed room protocol and release its per-peer ping,
transfer and ballot budgets on leave. Run the packaged behavior scenario
on the existing Linux CI path as well as Windows and macOS.
@ZenAlexa ZenAlexa changed the title perf: reduce packaged bundle and audio size perf: reduce package size and input/asset overhead Oct 17, 2026
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