Skip to content

09 Performance

Tagin T edited this page Nov 24, 2026 · 2 revisions

English | 中文

09 Performance by Scene Type

RTM is not uniformly N× faster. A scene made of 9,800 surface faces and a scene made of 10 labels stress different parts of the stack, and the gap against ManimCE depends on which part dominates. This page measures one representative workload per scene type on the same machine.

RTM vs. ManimCE

Scene type Workload (4 s @ 1080p60) ManimCE 0.21 RTM 2.0.12 Speedup
Vector primitives 120 rotating squares + 2 labels 10.1 s · 42 ms/f 6.6 s · 27 ms/f 1.5×
Dense vector 800 rotating circles 44.3 s · 184 ms/f 32.7 s · 136 ms/f 1.4×
Text 10 labels with updaters 6.9 s · 29 ms/f 5.6 s · 23 ms/f 1.2×
Static backdrop 1,200 squares + 8 labels, one rotor 4.8 s · 20 ms/f 3.4 s · 14 ms/f 1.4×
Image 1600×900 still, slow growth 44.9 s · 187 ms/f 3.3 s · 14 ms/f 14×
Image + scrim image + 480×270 alpha scrim 83.4 s · 347 ms/f 2.6 s · 11 ms/f 32×
Dense surface — painter 9,800 faces, 60 frames 4.5 s/frame 3.2 s/frame 1.4×
Dense surface — mesh same faces via MeshBatch 4.5 s/frame 2.5 ms/frame ~1,800×

The first six rows are complete 240-frame records (median of 3 runs). The last two rows are per-frame render cost over a 60-frame clip: CE at 1080p60, RTM through FrameServer.

Reading the table

  • Images are the biggest win among 2D workloads. A texture uploads once and the GPU scales it; ManimCE's Cairo path redraws and rescales the image on the CPU every frame while it grows. The alpha scrim is free after its first upload, so adding a second full-screen layer costs almost nothing.
  • Dense 3D depends on the route, not the engine. RTM's painter path is only ~1.4× faster than CE on 9,800 faces, because both are filling polygons on the CPU. The step change is MeshBatch / MeshMobject, which hands the same geometry to the GPU depth buffer — that is the ~1,800× row. Use the mesh route for anything with thousands of faces.
  • Vector, static and text scenes are CPU-bound on both sides, so the gap is 1.2–1.5×. The static layer makes RTM's own redraw nearly free, but cairo is already fast when nothing moves; text frames are dominated by rasterisation on both engines, and the text cache helps construction, not per-frame rasterisation.
  • A single number for "RTM is faster" is misleading. The README's 1.9–2.8× is a range for mixed 15-second scenes; the workloads here are uniform, so simple 2D rows land at 1.2–1.5×, while the image and mesh rows sit far above.

Before / after the optimisation

These are the internal wins that produced the numbers above (from the optimisation records, not all re-measured today):

Optimisation Workload Before After
Static-layer baking 1,200 static shapes + one rotor 160 ms/frame of redraw one quad per frame
Image texture cache 8 invisible 1600×900 images 82 ms/frame (67 ms image work) baseline ~15 ms/frame
Repeated Text build 50-character label, second build 36 ms 18 ms
Indexed batch build 18,432 quads, unchanged view 13.4 ms 0.04 ms (cached)
Shaded MeshMobject 9,800-face lathe, orbiting 3.4–4.2 s/frame 38–41 ms/frame
Mesh bake 9,800 faces 0.50 s 0.137 s

The first two rows are per-frame costs and scale with clip length. Text and the indexed build are one-off construction costs; the shaded MeshMobject row is per-frame; the mesh bake happens once.

Method

  • Machine: Intel Core Ultra 7 356H (16C), Intel Arc integrated GPU, 31.4 GB RAM, Windows 11 26200, Python 3.12.4.
  • Versions: real-time-manim 2.0.12, ManimCE 0.21.0 (Cairo), same source tree.
  • Workloads: 1920×1080 @ 60 fps, 240 frames (4.0 s), single process; ManimCE caching is disabled (disable_caching), RTM runs with its normal in-process caches. Each side runs the same shapes, fonts, colours and updaters; only the renderer differs.
  • Recording: RTM uses fast_record_scene (hidden window, per-frame readback → ffmpeg); ManimCE uses Scene.render (Cairo → PyAV). Both encode H.264 at the same resolution and frame rate.
  • Runs: three passes per workload; the table reports the median. Spread on this laptop can reach 2–3× for the lighter scenes when other work is running, so treat a single row as indicative rather than exact.
  • Surface: RTM painter and MeshBatch timings come from FrameServer.render_frame (no encode, median of 3 runs); CE's 4.5 s/frame is a single 60-frame render. This slightly disadvantages RTM (no encode in its figure) and is the conservative choice.

Caveats

  • Results are workload-specific. A scene with different geometry density, transparency or text volume will move along the same axes but not to the same numbers.
  • The two renderers do not produce byte-identical images (antialiasing, MSAA and text rasterisation differ), so this is a throughput comparison, not a pixel-diff.
  • Laptop clocks and integrated-GPU memory bandwidth vary with thermals; rerun the harness on the target machine before quoting a number.
  • jobs=N is not part of this table: it trades process startup and encode overhead for parallel frames, and helps long scenes, not 4-second ones.

The caching layers behind these numbers are described in 08 Caching, Performance & Limits.

Clone this wiki locally