finds.dev← search

// the find

LingDong-/q5xjs

★ 573 · JavaScript · Unlicense · updated Apr 2024

A small and fast alternative (experimental) implementation of p5.js

q5.js is a stripped-down reimplementation of the p5.js API that drops from 800KB to 33KB by removing parameter validation, DOM helpers, and the friendly error system. It targets developers who already know p5 and want better performance or less overhead, not beginners learning creative coding. Largely a drop-in replacement for 2D sketches, with some deliberate behavior differences.

The size reduction is real and meaningful — 33KB vs 800KB is not a rounding error, and that matters for embedded sketches and Observable notebooks. Image operation benchmarks show genuine wins (blurring: 0→40 FPS, grayscaling: 10→50 FPS) because it routes through Canvas filter API instead of per-pixel loops. The namespaced mode is a cleaner alternative to p5's instance mode — you get a plain object, not a closure wrapper. Functions usable outside setup/draw is a small but useful ergonomic improvement for mixing with other libraries.

No 3D support at all, and the README says '3D will likely come as an extension' — that was written in 2020 and it still hasn't happened. The repo is effectively dormant: last push was April 2024, 573 stars and 24 forks suggests a small audience that didn't grow. No test suite worth mentioning (tests.js exists but the tree shows no test framework), so compatibility claims are mostly manual. The p5 addon compatibility layer (q5.p5acl.js) is a shim that grafts p5 expectations onto a non-p5 object — it will break in ways that are annoying to debug when p5 addons assume internals that don't exist.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →