Skip to content

Conversation

@sid597
Copy link
Owner

@sid597 sid597 commented Nov 27, 2025

No description provided.

sid597 added 12 commits June 27, 2025 17:53
…duh we calculate the position again and again which is totally wrong
Major architectural refactor to decouple high-frequency input handling from
Electric's reactive graph, resolving main-thread blocking and GC thrashing.
Changes:
- Architecture: Switched from "Push" (Event-driven) to "Pull" (Atomic Sampling).
  Scroll inputs now mutate a raw atom bypassing the Electric DAG, which is
  sampled by a requestAnimationFrame loop. This enables true V-Sync at 120Hz/240Hz.
- Memory: Implemented "Zero Allocation" rendering path in editor.cljs.
  Hoisted all Float32Array and clj->js object creation out of the hot loop
  into the setup phase. Mutating existing buffers instead of creating new ones
  eliminated GC spikes.
- Logic: Implemented "Render on Invalidation".
  The render loop now sleeps (0% CPU) when idle and is woken up only by input
  events, preventing battery drain while maintaining instant responsiveness.
- Modules:
  - app.client.webgpu.editor: Low-level, zero-alloc GPU command encoder.
  - app.client.webgpu.loop: Input scheduler, HUD, and RAF manager.
  - app.electric-flow: Lifecycle management and resource loading.
- UX: Added performance HUD to track CPU dispatch time and FPS.
- Fix: Synced Canvas DOM attributes to window pixel ratio to fix blurry text.
- Fix: Added user-select: none to prevent text highlighting during scroll.
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