-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
tests/python/gc_stress/many_large_single_row_recordings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
""" | ||
Stress test for cross-recording garbage collection. | ||
Logs many large recordings that contain a single large row. | ||
Usage: | ||
- Start a Rerun Viewer in release mode with 500MiB of memory limit: | ||
`cargo r -p rerun-cli --release --no-default-features --features native_viewer -- --memory-limit 500MiB` | ||
- Open the memory panel to see what's going on. | ||
- Run this script. | ||
- You should see recordings coming in and going out in a ringbuffer-like rolling fashion. | ||
""" | ||
from __future__ import annotations | ||
|
||
import time | ||
|
||
import rerun as rr | ||
from numpy.random import default_rng | ||
|
||
rng = default_rng(12345) | ||
|
||
for i in range(0, 20000000): | ||
rr.init("recording-gc", recording_id=f"recording-gc-rec-{i}", spawn=True) | ||
|
||
positions = rng.uniform(-5, 5, size=[10000000, 3]) | ||
colors = rng.uniform(0, 255, size=[10000000, 3]) | ||
radii = rng.uniform(0, 1, size=[10000000]) | ||
rr.log("points", rr.Points3D(positions, colors=colors, radii=radii)) | ||
|
||
# Sleep so we don't run out of TCP sockets. | ||
# Timings might need to be adjusted depending on your hardware. | ||
time.sleep(0.05) |
27 changes: 27 additions & 0 deletions
27
tests/python/gc_stress/many_medium_sized_many_rows_recordings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
""" | ||
Stress test for cross-recording garbage collection. | ||
Logs many medium-sized recordings that contain a lot of small-ish rows. | ||
Usage: | ||
- Start a Rerun Viewer in release mode with 500MiB of memory limit: | ||
`cargo r -p rerun-cli --release --no-default-features --features native_viewer -- --memory-limit 500MiB` | ||
- Open the memory panel to see what's going on. | ||
- Run this script. | ||
- You should see recordings coming in and going out in a ringbuffer-like rolling fashion. | ||
""" | ||
from __future__ import annotations | ||
|
||
import rerun as rr | ||
from numpy.random import default_rng | ||
|
||
rng = default_rng(12345) | ||
|
||
for i in range(0, 20000000): | ||
rr.init("recording-gc", recording_id=f"image-rec-{i}", spawn=True) | ||
for j in range(0, 10000): | ||
rr.set_time_sequence("frame", j) | ||
positions = rng.uniform(-5, 5, size=[1000, 3]) | ||
colors = rng.uniform(0, 255, size=[1000, 3]) | ||
radii = rng.uniform(0, 1, size=[1000]) | ||
rr.log("points", rr.Points3D(positions, colors=colors, radii=radii)) |
32 changes: 32 additions & 0 deletions
32
tests/python/gc_stress/many_medium_sized_single_row_recordings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
""" | ||
Stress test for cross-recording garbage collection. | ||
Logs many medium-sized recordings that contain a single medium-sized row. | ||
Usage: | ||
- Start a Rerun Viewer in release mode with 500MiB of memory limit: | ||
`cargo r -p rerun-cli --release --no-default-features --features native_viewer -- --memory-limit 500MiB` | ||
- Open the memory panel to see what's going on. | ||
- Run this script. | ||
- You should see recordings coming in and going out in a ringbuffer-like rolling fashion. | ||
""" | ||
from __future__ import annotations | ||
|
||
import time | ||
|
||
import rerun as rr | ||
from numpy.random import default_rng | ||
|
||
rng = default_rng(12345) | ||
|
||
for i in range(0, 20000000): | ||
rr.init("recording-gc", recording_id=f"recording-gc-rec-{i}", spawn=True) | ||
|
||
positions = rng.uniform(-5, 5, size=[10000, 3]) | ||
colors = rng.uniform(0, 255, size=[10000, 3]) | ||
radii = rng.uniform(0, 1, size=[10000]) | ||
rr.log("points", rr.Points3D(positions, colors=colors, radii=radii)) | ||
|
||
# Sleep so we don't run out of TCP sockets. | ||
# Timings might need to be adjusted depending on your hardware. | ||
time.sleep(0.05) |