Skip to content

Myaku ​

脈 (myaku): pulse. A frame profiler for web games.

Myaku watches every frame your game draws. It finds the ones players feel drop and tells you why, in plain words:

Frame 1,204 took 79 ms (budget 9.1 ms). 80 ms was script: spawnWave in src/enemies.ts:88. This ran inside the game loop. Profile the function in the Performance panel, or spread the work over several frames.

ts
// First line of your entry file, in development only:
import "myaku/auto";

Get started · Reading verdicts · CI budgets · API reference

Why myaku ​

Stutter is the bug players notice first and developers find last. The browser's Performance panel can find it, but only if you were recording when it happened, and only if you can read a flame chart. Most hitches are never explained. They get blamed on "the browser", or on the machine.

Myaku is built for game questions instead:

  • Always on. It keeps the last ten seconds of frames. When you feel a hitch, it's already recorded.
  • Verdicts, not flame charts. Every slow frame gets a cause, a confidence and a next step.
  • Counts what games care about. Frame time as players feel it, time in your frame code, draw calls, bytes uploaded to the GPU, shader compiles, and garbage collection.
  • Any engine. Phaser, PixiJS, three.js, KAPLAY, Excalibur, a hand-written loop or debuff. No changes to the game.
  • Cheap. No allocations per frame. Its own cost is measured and reported, typically 0.05–0.1 ms a frame.

What it finds ​

CauseMeaning
scriptYour code ran long. Names the function and file when the browser reports it
gcGarbage collection: the heap shrank while your code was idle
uploadTextures or buffers sent to the GPU mid-play
compileShaders compiled mid-play
layoutStyle and layout work, usually DOM UI over the canvas
throttledThe browser slowed frames down (hidden window, power saving), not your game
hiddenThe tab was in the background
unknownYour code was quick and the time went elsewhere. Myaku says so instead of guessing

More on each cause →

Part of debuff, usable anywhere ​

Myaku is an independent package with no dependency on debuff. In debuff projects, debuff dev starts it for you, with the game's update and render as spans, and coding agents read it through the MCP server's game_profile tool.