# wilsonpage/fastdom

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/wilsonpage-fastdom).**

6,920 stars · 235 forks · JavaScript

## Links

- GitHub: https://github.com/wilsonpage/fastdom
- awesome-repositories: https://awesome-repositories.com/repository/wilsonpage-fastdom.md

## Description

Fastdom is a task scheduler and rendering optimizer designed to prevent layout thrashing by batching document reads and writes. It functions as a coordination system that separates document measurements and mutations into distinct queues, ensuring that asynchronous operations are executed in a way that minimizes browser reflows.

The project provides a performance profiling capability that detects improper document API access. By enforcing strict execution phases, it identifies layout thrashing bottlenecks and flags unauthorized DOM access occurring outside of the coordinated batching cycles.

The system manages the rendering workflow by aligning execution cycles with the browser refresh rate. It includes capabilities for grouping read-only operations and write operations, as well as a mechanism for cancelling pending tasks using unique identifiers.

The scheduler can be extended via a plugin system to add custom task types to the global execution pipeline.

## Tags

### Software Engineering & Architecture

- [Rendering Phase Coordination](https://awesome-repositories.com/f/software-engineering-architecture/async-operation-coordinators/rendering-phase-coordination.md) — Separates measurement and mutation tasks into distinct queues to optimize rendering performance and prevent layout thrashing. ([source](https://github.com/wilsonpage/fastdom/blob/master/bower.json))
- [Execution Phases](https://awesome-repositories.com/f/software-engineering-architecture/execution-phases.md) — Uses sequenced execution phases to ensure all DOM measurements are completed before any mutations occur.
- [High-Frame-Rate Rendering](https://awesome-repositories.com/f/software-engineering-architecture/performance-reliability/performance-optimization/data-handling-throughput/large-dataset-optimizations/high-frame-rate-rendering.md) — Optimizes JavaScript rendering to ensure high frame rates by managing asynchronous document operations.
- [Task Queues](https://awesome-repositories.com/f/software-engineering-architecture/task-queues.md) — Maintains a centralized architectural task queue to process pending operations sequentially during animation frames.

### Web Development

- [Web Performance Optimization Tools](https://awesome-repositories.com/f/web-development/web-performance-optimization-tools.md) — Provides a coordination system that optimizes web application performance by batching DOM read and write operations.
- [Browser Reflow Management](https://awesome-repositories.com/f/web-development/browser-reflow-management.md) — Groups multiple document mutations into single updates to minimize the number of browser layout reflows.
- [DOM Read Batching](https://awesome-repositories.com/f/web-development/dom-read-batching.md) — Groups read-only document operations into a single queue to prevent layout thrashing. ([source](https://github.com/wilsonpage/fastdom#readme))
- [DOM Rendering Coordination](https://awesome-repositories.com/f/web-development/dom-rendering-coordination.md) — Manages the order of document measurements and mutations to ensure smooth animations and high frame rates.
- [DOM Task Batching](https://awesome-repositories.com/f/web-development/dom-task-batching.md) — Coordinates the separation of document measurements and mutations into distinct queues for optimized execution.
- [DOM Write Batching](https://awesome-repositories.com/f/web-development/dom-write-batching.md) — Groups write operations into a single queue to ensure they execute after all measurements to minimize reflows. ([source](https://github.com/wilsonpage/fastdom#readme))
- [Layout Thrashing Prevention](https://awesome-repositories.com/f/web-development/layout-thrashing-prevention.md) — Prevents browser reflows and layout thrashing by batching DOM reads and writes via a task scheduler.
- [Visual Update Coordination](https://awesome-repositories.com/f/web-development/visual-update-coordination.md) — Coordinates JavaScript callbacks with the browser's paint cycle using requestAnimationFrame to minimize reflows.
- [DOM Access Detection](https://awesome-repositories.com/f/web-development/dom-access-detection.md) — Throws errors when sensitive DOM APIs are accessed outside the batching system to identify performance bottlenecks. ([source](https://github.com/wilsonpage/fastdom#readme))
- [DOM API Interception](https://awesome-repositories.com/f/web-development/dom-api-interception.md) — Provides an interception layer to detect unauthorized DOM access occurring outside of coordinated batching cycles.
- [Layout Thrashing Detection](https://awesome-repositories.com/f/web-development/layout-thrashing-detection.md) — Triggers errors when DOM APIs are called outside coordinated measurement and mutation cycles to detect thrashing. ([source](https://github.com/wilsonpage/fastdom/blob/master))
- [Rendering Phase Enforcement](https://awesome-repositories.com/f/web-development/rendering-phase-enforcement.md) — Enforces a strict mode that throws errors when DOM APIs are accessed outside of designated measure or mutate phases. ([source](https://github.com/wilsonpage/fastdom/blob/master/README.md))

### Development Tools & Productivity

- [Dual-Queue Scheduling](https://awesome-repositories.com/f/development-tools-productivity/task-queues/dual-queue-scheduling.md) — Implements a dual-queue system to separate document reads and writes, preventing interleaved layout thrashing.

### Mobile Development

- [UI Performance Debugging](https://awesome-repositories.com/f/mobile-development/android-application-debugging/ui-performance-debugging.md) — Identifies layout thrashing bottlenecks by analyzing rendering timing and improper DOM API access.

### Networking & Communication

- [Job Execution Cancellations](https://awesome-repositories.com/f/networking-communication/message-scheduling/scheduled-task-cancellation/job-execution-cancellations.md) — Provides a mechanism to abort pending measurement or mutation jobs using unique identifiers. ([source](https://github.com/wilsonpage/fastdom/blob/master/README.md))

### Testing & Quality Assurance

- [DOM Rendering Profilers](https://awesome-repositories.com/f/testing-quality-assurance/dom-rendering-profilers.md) — Detects improper DOM API access and identifies layout thrashing through strict execution phase enforcement.
