rerun icon indicating copy to clipboard operation
rerun copied to clipboard

Rerun viewer becomes slow when there are several hundreds of entities

Open emilk opened this issue 1 year ago • 5 comments

We currently don't have a good example of this. The best we got is

pixi run py-build-examples && pr -e examples open_photogrammetry_format --no-frames

and

  • https://github.com/rerun-io/rerun/pull/5449

Related issues

  • https://github.com/rerun-io/rerun/issues/3110
  • https://github.com/rerun-io/rerun/issues/8101
  • https://github.com/rerun-io/rerun/issues/5799

emilk avatar Aug 08 '24 12:08 emilk

Here's a very simple example that makes the viewer totally unuable:

import rerun as rr

from rerun.datatypes import RotationAxisAngle

rr.init("rerun_example_many_entities", spawn=True)


def one_strip(number_points: int):
    return rr.LineStrips3D(
        [[0.3 if i % 2 == 0 else -0.3, i, 0] for i in range(number_points)],
    )


def rotate(theta: float):
    return rr.Transform3D(
        rotation_axis_angle=RotationAxisAngle(axis=[0, 0, 1], degrees=theta),
        axis_length=0,
    )


def draw_lines(lines_count: int, pts_per_line: int):
    theta_delta = 360 / lines_count
    for i in range(lines_count):
        rr.log(f"line_{i}", rotate(theta_delta * i))
        rr.log(f"line_{i}/strip", one_strip(pts_per_line))

draw_lines(5000, 10)

jleibs avatar Oct 17 '24 18:10 jleibs

I'm trying to get a feel for what is slow. I tried to patch some things and cache others and this is what I see.

Is this slow for the air traffic example?

https://github.com/user-attachments/assets/7f8ce393-2dff-42e2-962f-3b84cadd70aa

joelreymont avatar Oct 28 '25 15:10 joelreymont

@joelreymont "is this slow" is hard to answer without any context like what you're testing, what you're machine running on etc.. A blurry video recording is definitely not sufficient ;-). Also as far as I can tell from that one you're running in debug mode and while we do care about performance of unoptimized builds that's more of an afterthought and not what we profile against. Today we generally think that airtraffic is an example that is too slow on both frame time/rendering as well as ingestion with exact numbers varying a lot on what's on screen of course. If you want to explore what takes time check the profiler in the menu

Wumpf avatar Oct 29 '25 14:10 Wumpf

Took a stab with PR #11743. See related PRs #11741 and #11720.

joelreymont avatar Oct 31 '25 10:10 joelreymont

This branch combines the three PRs above.

joelreymont avatar Oct 31 '25 10:10 joelreymont