Commit f11d10b
Add heavy-topic ros2 topic hz demo (rclpy vs rclcppyy) + startup story
A ros2 topic hz-style showcase on a heavy topic (1024x1024 sensor_msgs/Image,
3.0 MB) where plain rclpy visibly falls behind and the accelerated subscriber
does not, plus the cold-vs-warm bringup story. Under scripts/heavy_hz_demo/:
- heavy_publisher.py: C++-accelerated publisher; builds the 3 MB image once and
re-publishes at a target rate, so it is never the bottleneck under test.
- hz_subscriber.py: the ros2 topic hz equivalent (windowed rate, recv/expected,
drops via header seq, latency). SAME script both ways -- the only difference is
whether `import rclcppyy; rclcppyy.enable_cpp_acceleration()` executes
(gated on HEAVY_HZ_ACCEL). It reads only header fields, never the payload.
- run_heavy_hz.py: orchestrator (spawns the pair, warms up, samples per-process
CPU, parses stats, prints a table) + --startup-story (cold vs warm bringup).
- startup_probe.py: single-process bringup probe for the startup story.
Measured (3.0 MB, RELIABLE KEEP_LAST depth 10, cyclonedds LOCALHOST): at 100 Hz
both keep up but rclpy burns ~2.6x the CPU; the knee is ~200 Hz for 3 MB -- plain
rclpy tops out ~210 Hz (pegging ~1.6 cores) while the accelerated subscriber
climbs to 336 Hz @500 target and 417 Hz @700, at half the CPU and a third of the
latency. Startup: rclcpp headers parse ~1.7s cold -> 0.0s warm (Cling PCH).
RELIABLE is deliberate: net.core.rmem_max is 208 KB, so BEST_EFFORT drops whole
3 MB messages to socket-buffer overflow (noise unrelated to the subscriber).
Wiring:
- pixi.toml: heavydemo feature/env (solve-group=default, no extra conda deps) +
tasks demo-heavy-hz / -rclpy / -rclcppyy / demo-heavy-startup; isolated
XDG_CACHE_HOME=.heavy_demo_cache for the auto-PCH cache.
- workspace_activation.sh: DEV/demo-only bridge, gated on
PIXI_ENVIRONMENT_NAME=heavydemo, prepending a .suite_bridge symlink dir
(cppyy_kit + rclcpp_kit from a sibling ../cppyy_kit checkout, override with
CPPYY_KIT_SRC) to PYTHONPATH so the demo runs on the newer zero-config auto-PCH
that postdates the published suite 0.1.0. No-op in every other env; the default
env's published-channel dependency is untouched.
- README: "Heavy-topic ros2 topic hz showcase" section with the measured tables,
exact commands, the bridge note, and the honest boundaries.
- test/test_heavy_hz_demo.py: headless smoke test of the machinery on plain rclpy
(tiny image, short window, sanity only) so it runs in the default env / CI.
pixi run test: 27 passed. pixi run lint: clean.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent b34dddf commit f11d10b
11 files changed
Lines changed: 1476 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
25 | 28 | | |
26 | 29 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
232 | 320 | | |
233 | 321 | | |
234 | 322 | | |
| |||
0 commit comments