What is the best API to use, when I need to draw tens of thousands of cubes or rectangles?
Currently, if I draw 50k rectangles for my entire map, it takes dozen of ms per frame.
Is there maybe some batch command to speed it up?
Or maybe the fastest possible API call? e.g. box or rect?
they are static, never move.
However in some cases, I need to add new ones or delete existing ones (as these rectangles represent blocked cells by stuff like props or buildings)
Indeed the param renders it nicely in the game, however there doesnt seem to have any noticable performance gain, if I try to render the spheres on our entire map grid (100x100) (I mean using builder vs rendering it just in Update() loop)
The important thing is that you only render it once during Start. Then the redraw scope will keep it active with very low cost. (at least assuming you are not using any WithPersistent scopes, or InScreenSpace).