plugfast
v0.1.0
Published
Drop-in React layer that speeds up specific heavy frontend workloads (virtualized table/list, off-main-thread sort/filter, content-visibility wrapper) via native features. Every claim is measured — no hype.
Maintainers
Readme
plugfast
Drop-in React layer that speeds up specific heavy frontend workloads using native browser features. Every performance claim is measured — there is no "1000×".
npm i plugfastWhat it does
| API | What | The honest win |
|-----|------|----------------|
| <Fast> | wrap any subtree | skips layout/paint while off-screen (content-visibility) + optional mount-on-visible |
| <FastTable> | virtualized table | only the viewport is in the DOM |
| <FastList> | virtualized list | only the viewport is in the DOM |
| useFastQuery | sort/filter big arrays | runs off the main thread for large inputs, sync for small, with a correct fallback |
| createWorkerPool | worker pool | sized to hardwareConcurrency; degrades to sync when workers are unavailable |
| sortRows / filterRows | pure engine | numeric sort via O(n) radix: ~5–11× over a naive comparator (≈10× at 1M rows, measured); strings 1.5× |
Quick start
import { FastTable, useFastQuery } from "plugfast";
function Trades({ rows }) {
const [sort, setSort] = useState({ key: "pnl", dir: "desc" });
const { rows: shown, pending } = useFastQuery(rows, { sort }); // off-thread for big data
return (
<FastTable
rows={shown}
columns={[{ key: "symbol", header: "Symbol" }, { key: "pnl", header: "P&L" }]}
onSortChange={setSort}
sort={sort}
/>
);
}Honest ceiling
Speeds up: large list/table render, sort/filter over big arrays, off-screen subtrees. Does not speed up: network, your app's own layout thrash, already-small workloads, or an arbitrary component's on-screen render. The fast path is an optimization, never a correctness dependency — it always falls back to correct plain JS.
MIT.
