r/javascript • u/One-Antelope404 • Apr 14 '26
AskJS [AskJS] What are the real architectural limits of using console.log + %c as a pixel renderer, and how would you push past them?
Context: I've been experimenting with SDF ray-marching rendered entirely via styled console.log calls — each "pixel" is a space character with a background-color CSS style injected through %c format arguments. No canvas, no WebGL. The scene includes soft shadows, AO, and two orbiting point lights at ~42×26 pixels, doing around 11k ray-march steps per frame.
I've hit a few walls I don't have good answers for and wanted to hear how people would actually approach them:
Each frame is one console.log with 1000+ %c args — the format string alone is 80–120kb. Is there a CDP-level trick that beats this, or is this just the hard ceiling?
Partial redraws seem impossible since the console only appends. Has anyone found a diffing approach that meaningfully reduces redundant output?
Soft shadows need a secondary ray-march per light per pixel — the main bottleneck. Can a SharedArrayBuffer + Worker pool realistically pre-compute the framebuffer before the log call, or does the transfer cost kill it?
Would a WASM SDF evaluator actually move the needle here, or is the bottleneck firmly on the DevTools rendering side?
Is temporal supersampling (alternating sub-pixel offsets frame-to-frame) something the human eye would even pick up given the console's reflow latency?
Memory creep from non-cleared frames — anyone have a cleaner solution than "hard clear every N frames and eat the flash"?
11
u/backwrds Apr 14 '26
If a human had written this post, it might be kinda fun, but this is just a waste of electricity.
2
u/captain_obvious_here void(null) Apr 14 '26
This sounds awesome! Full of constraints, not made for this at all, but a lot of fun!
Do you have some demo to show us?
2
u/bearicorn Apr 14 '26
Ask the AI that coded it!
1
u/IsopodInitial6766 Apr 14 '26
You’re mostly hitting DevTools limits, not JS limits.
The real bottleneck is the console renderer. Every
console.logforces DevTools to parse the huge format string, create nodes, apply styles, and repaint — which is much slower than the raymarch math.Partial redraws don’t really work since the console is append-only, and diffing still creates new log entries internally. Workers or WASM might speed up compute, but if DevTools paint is the bottleneck you won’t gain much FPS.
The main trick is minimizing console work — e.g. rendering to a canvas and injecting it as a single
%cbackground image so DevTools only has to paint one node instead of thousands.