Hi,
@Corjan In the instrument I am doing there am many canvas_add()
What is better?
1) Lots of canvas_add() with lots of visible() and few canvas_draw().
2) Few canvas_add() with lots of visible() and lots of canvas_draw()
3) Does the size of the canvas make a difference if only a small part of the canvas is used?
My canvas_add() count is over 100. Not all are drawn many times. Most moved, rotated and made visible or not.
Keith
Lots or Few
- Keith Baxter
- Posts: 4685
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Lots or Few
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board, 32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card
Re: Lots or Few
Hi,
1) Very fast
2) canvas_draw is expensive compared to visible/rotate/move/viewport/opacity.
3) No
In general, try to segment your code the best possible. So multiple small canvasses/subscriptions.
Aggregating a lot of data together in one subscription will make that callback being called a lot. And if you have a big canvas in the callback, that also has to be completely redrawn every time. That can become expensive.
Corjan
1) Very fast
2) canvas_draw is expensive compared to visible/rotate/move/viewport/opacity.
3) No
In general, try to segment your code the best possible. So multiple small canvasses/subscriptions.
Aggregating a lot of data together in one subscription will make that callback being called a lot. And if you have a big canvas in the callback, that also has to be completely redrawn every time. That can become expensive.
Corjan
- Keith Baxter
- Posts: 4685
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Re: Lots or Few
Awesome, Thank you Corjan.Corjan wrote: ↑Sat Nov 21, 2020 1:57 pm Hi,
1) Very fast
2) canvas_draw is expensive compared to visible/rotate/move/viewport/opacity.
3) No
In general, try to segment your code the best possible. So multiple small canvasses/subscriptions.
Aggregating a lot of data together in one subscription will make that callback being called a lot. And if you have a big canvas in the callback, that also has to be completely redrawn every time. That can become expensive.
Corjan
What I was thinking.
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board, 32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card