Skip to main content

Profiler

The Profiler window records every frame while your game plays in the editor, like Unity's Profiler. Use it when the game stutters or runs below 60 fps and you want to know why.

Open it with Window → Profiler. It opens under the game view, so you see the game and its frames together, and starts recording when you press Play. To record the game on a phone, in its own window or as a web build, see Record a phone.

The chart​

Each thin bar is one frame, newest on the right, about the last 15 seconds. In CPU view a bar's height is how long the frame took the processor, coloured by what the time went to (render, physics, behaviors…). Lines mark 16.7 ms (60 fps) and 33.3 ms (30 fps): bars above the first line are frames that missed 60 fps.

Click or drag on the chart to pick a frame. ◀ ▶ (or the arrow keys) step one frame back or forward, ⏭ goes back to following the newest one. The bar above the chart shows the frame's number, time and frame rate.

The frames stay when you press Stop, so you can look through a run afterwards. ● turns recording off and on (on starts a new recording), ⌫ clears it.

CPU​

Where the picked frame's time went:

ColumnWhat it lists
FrameThe parts of the frame, slowest first, with their share of the frame (see below).
ScriptsEach code script's time in this frame and how many times its functions ran (×3).
BehaviorsTime per behavior (Platformer, Car, Follow…) and on how many objects it ran (×12).
EventsThe slowest events of the event sheets. Click one to open it in its sheet.

The parts of the frame:

PartTime spent on
Renderdrawing the frame
Physicsmoving bodies and finding collisions
Collision eventsOn collision events and onCollision() in scripts
BehaviorsPlatformer, Car, Follow and the other behaviors
Eventsthe event sheet
Scriptscode scripts' update() and other functions
Animationmodel animation
Particlesparticle effects
Input & UItouches, keys and the screen UI

The browser measures time in steps of 0.1 ms, so very quick parts show as 0.10 ms or 0.

Rendering​

What the picked frame drew: draw calls (shadows and screen effects included), triangles, objects drawn together as one batch, the meshes, textures and shaders on the graphics card, and the number of objects, physics bodies and live particles. The chart shows draw calls per frame. On phones, draw calls are usually the first thing to bring down: see Performance.

Script memory is the page's JavaScript memory, shown in Chrome and Edge only. If it keeps climbing during a run, something keeps making objects that are never removed.

Memory​

Take snapshot lists what the running scene holds, biggest first:

  • Textures: each picture with its size in pixels and the memory it takes on the graphics card. Light maps, the sky and light probes are listed too.
  • Meshes: models (by file) and shapes (by object), with their triangles.
  • Sounds: each sound loaded so far, with its length and the memory it takes decoded (sounds are much bigger played than in the file).

A huge sky picture or a texture far bigger than it shows on screen is the usual find: make it smaller in Files or lower Max lightmap size.

Record a phone​

A phone is much slower than your computer, so measure the game there. Like Unity's profiler connected to a phone build, the game sends its frames to your editor over the internet; no cable is needed.

  1. Press 📱 in the Profiler. It shows a short code (for example K7Q2X), and the button shows it too while it waits.
  2. Open the game with that code:
    • Published game (Publish): scan the QR code with the phone's camera. It opens your game's link with the code added. No QR? The game isn't published from this browser yet: press 🌍 Publish next to the code, and the QR shows when it's done.
    • Play in a new window (Play ▾ → Play mode → New window): press Play. The window joins by itself.
    • Web build or any other link to the game: add ?tgeprofile=K7Q2X to its address.
  3. When the game is running, the button shows the device (Android 14 · Chrome 131 · 1080×2400) and the chart fills with its frames. CPU, Rendering and Memory (Take snapshot asks the phone) work as for a game in the editor. ● turns recording on the phone off and on.

When the game closes, its frames stay to look through. ✕ Disconnect ends it; the Profiler then records the editor's game again.

note

A game published before this feature has to be published again (Publish → Update, same link) before it can send frames. Android app and Windows builds can't be connected yet.

Good to know​

  • Times are rounded to 0.1 ms by the browser, so very fast parts show as 0.10 ms or nothing.
  • Recording costs a little time itself, only while the Profiler is open. A connected phone also sends about 3 KB of frames a second.
  • The game's own frame is measured. The browser's time on the page and the graphics card's time are not, so a game can show 5 ms frames and still run at 40 fps when the graphics card is the limit: look at Rendering then.