Converting colors in JavaScript at 6B operations per second

A wild speed flex turns into a comment war over hype, AI writing, and whether anyone needs this

TLDR: The big news is that a color tool got dramatically faster by using the graphics chip to draw millions of pixels at once instead of leaning on the main processor. Commenters split hard between “smart engineering” and “obvious demo,” with a side of drama over whether the article itself sounded AI-written.

A developer showed off a way to convert colors in JavaScript at a mind-bending 6 billion operations per second by handing the job to the graphics chip instead of the main processor. In plain English: instead of asking your computer’s “brain” to repaint every tiny dot on the screen one by one, it lets the graphics hardware do the repetitive heavy lifting all at once. On paper, it’s a huge leap for things like live color pickers and visual tools that redraw giant color maps every frame. But in the comments, the actual performance story quickly got upstaged by the crowd reaction.

One camp was genuinely impressed, with readers calling out the real trick: not bouncing results back and forth between the graphics chip and the CPU, which usually kills the speed boost. That detail had the “okay, this is actually clever” crowd nodding along. Another camp, though, came in swinging. Critics dismissed the whole thing as “a fragment shader doing simple math very fast,” basically saying: congratulations, water is wet, graphics chips are good at graphics. Then the thread swerved into a different kind of roast, with multiple commenters accusing the post’s writing style of sounding suspiciously AI-made. Suddenly the debate wasn’t just “is this useful?” but also “did a robot write the explainer?”

And because this is the internet, there was also nostalgia bait: one commenter used the moment to fondly remember old OpenGL tutorials and ask where the modern beginner-friendly WebGL guides are. So the vibe was a perfect tech-forum cocktail: one part admiration, one part eye-roll, one part style-policing, and one part ‘kids today don’t know NeHe.’

Key Points

  • The article says @colordx/core performs JavaScript color parsing and conversion with V8-specific optimizations, zero dependencies, and a 7 KB footprint.
  • It reports a CPU benchmark of about 200 ns for HEX-to-OKLCH conversion on an Apple M4, or roughly 5 million conversions per second on one core.
  • The article argues that real-time rendering workloads, such as repainting a 1024×1024 view at 60 fps, require over 60 million color conversions per second.
  • It explains that GPUs are better suited than CPUs for this workload because many pixels can be processed independently in parallel.
  • The GPU implementation, @colordx/gpu, uses a WebGL fragment shader to run OKLCH-to-sRGB conversion and gamut checks for every pixel.

Hottest takes

"they never read data back from the GPU to the CPU" — rohitsriram
"Cool tech, but the writing flags as AI" — hypfer
"i let a fragment shader do very simple math and it was very fast" — well_ackshually
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.