slint icon indicating copy to clipboard operation
slint copied to clipboard

Reduce allocations of scene items in the sw renderer

Open tronical opened this issue 2 years ago • 5 comments

Allocate capacity for scene item vector with the number of items from the last scene.

That shaves off about 1-2ms of pre-scene time on the pico and stm32.

I'm not entirely sure that this is worth the complexity. Or perhaps there's a much simpler way?

tronical avatar Jun 15 '22 07:06 tronical

Why not keep the state in the LineRenderer itself? (yeah, this will be useless when using the rendering by buffer, but it's not so much data)

Also this is only for one of the vector, but there is a bunch of vector where we append items, in particular the texture vector should have about the same size. so this may be another ~2ms if we do it for the other vectors.

ogoffart avatar Jun 15 '22 08:06 ogoffart

Sure, good idea - I don't mind keeping it there then. That's certainly less intrusive!

tronical avatar Jun 15 '22 13:06 tronical

Why not keep the state in the LineRenderer itself? (yeah, this will be useless when using the rendering by buffer, but it's not so much data)

Also this is only for one of the vector, but there is a bunch of vector where we append items, in particular the texture vector should have about the same size. so this may be another ~2ms if we do it for the other vectors.

Done. This is less intrusive now.

tronical avatar Jul 07 '22 15:07 tronical

How is the speed with that path now? Does it improve perfs on the pico?

ogoffart avatar Jul 07 '22 16:07 ogoffart

How is the speed with that path now? Does it improve perfs on the pico?

My pico is in the office :(. I can check next week.

tronical avatar Jul 07 '22 16:07 tronical

Deferring this for now as I'm not working on this at the moment.

tronical avatar Oct 26 '22 13:10 tronical