Worse performance with dynamic batching ON

Hi, on iPhone 4 with Dynamic Batching ON i get an average of 20 drawcalls and 50 batched. With Dynamic batching turned OFF i have an average of 70 drawcalls. Now my issue is… how is possibile that i get better performance (the game is more fluid and with less stuttering) with it switched to OFF and 70 drawcalls? 90% of my drawcalls are just opaque planes that i use to create my backgrounds.

May the CPU have more difficulty batching 50 planes that not drawing 50 more drawcalls?

i made a tiny benchmark project with unity and i also noticed weird stuff like that act differently on desktop and mobile… check if vsync is on or if any antialiasing or ansitropic is active, which are the features ive seen cause weird results…also ive seen using vertex lighting is slower than forward rendering…so i just stopped trying to come to a logical conclusion and just use whatever settings give you better performance

Up to a certain point it’s not a surprise, let’s pretend that you draw your 70 objects with no effort, in order to have batching you have to spend some time calculating stuff, packaging things, and that has a cost for the CPU, so it’s not a surprise if disabling batch will perform a little bit better on some scenarios :slight_smile:

@hermesdavidms
Vsync it’s on by Default on iOS, so even if i turn it off nothing change, and yes i’ve disabled AA too, in both case i still get better performance with dynamic batching off. Yeah, some of these things are really strange.

@Eskema
You may have a point. But still feel a bit strange, having 50 more drawcalls should still be more cpu intensive.

I just found out that wasn’t the dynamic batching itself that was slowing down my FPS, but using “Optimize Mesh” in some of my models would cause the dynamic batching to go crazy with huge spike on MeshRenderer.RenderDynamicBatch. I disabled Optimize Mesh in some of my models and the huge spikes are gone.

1 Like