Identifying a bottleneck - Low FPS

I have been playing around with a few different setups with multiple PB V3’s and have noticed FPS is a little lacking, whether patterns are math heavy or not.

For example, when running the ‘3D Rotational Spotlights’ pattern I’m getting around 20fps. Whereas the person who made the pattern was getting around 45fps with more pixels.

My question is, where am I getting pinched? I suspect its the WS2812’s but am also unsure if how your map is set up can influence FPS in anyway.

My setup is as follows:

PB V3.16
336 WS2812 Pixels mapped in a JSON array

Hi @frostnova37,
A quick and easy way to test if LEDs / IO are a bottleneck is to switch to “No LEDs” for the LED type. That will still run through all the work and you can still see the first 100 pixels via the live preview, but doesn’t have any of the IO.

@jeff was running 384 WS2812 pixels on his cube but doing so via the output expander, which can help boost FPS by parallelizing data across multiple channels and handles all the protocol stuff.

I’m getting about 45 FPS with 256 pixels in a 2D arrangement w/o expander. It does drop a bit if I load a 3D pattern. There’s some extra code that runs in that patten in 3D mode.

Aside from what the pattern does with the extra coordinate information, the overhead of 2D or 3D is pretty low. e.g.

Using the “New Pattern” rainbow, 256 pixels, type set to No LEDs and changing which render method is defined and pixel map installed:
1D render: 468 FPS
2D render: 464 FPS
3D render: 466 FPS
2D render using x in place of index/pixelCount: 535 FPS
3D render using x+y+z in place of index/pixelCount: 449 FPS

1 Like

This is all very interesting. I thought the expander had more use cases when you were controlling thousands of pixels, luckily I ordered one with my last set of PB’s to play around with.

Running a rainbow with 336 pixels set to No LEDs I’m sitting at 350~ FPS. Swapping to WS2812’s it plummets to 75~ FPS. Setting up the expander for 4 channels of 84 pixels lands 170~ FPS. Which is the same result as swapping from WS2812’s to APA102’s. Its interesting to prod around to see the breakpoints between the LED type/count, expander setups and patterns.

So if I’m FPS hunting its looking like I either plumb in the expander or get some fancy DotStars. For context I am still working on my infinity lamp project, the reason for trying to maximise ‘bandwidth’ is that the next rig will have 520 ish pixels and I want to make sure I’m doing what I can to hit smooth frame rates. I’ve not worked with DotStars yet, am I shooting myself in the foot trying to get WS2812’s to zoom? are they that much faster?

Unless the project’s scale means it’s at the edge of what I can afford, I prefer almost any project plan for DotStars now. The FPS yes, but also the low end dynamic range. I think it’s almost always worth the extra cost for projects where I can afford it. One downside is you can’t find them in as many form factors, like bullets.

In theory, the 30MHz / 32bit DotStar/APA102/SK9822 can update at 940,000 LEDs per second. I’ve seen as high as 260,000/s for a trivial pattern on a PB v3. The WS28XX signal protocol maxes out at 33,000 per second.