# FPS is lower with smaller number of vertices and higher with higher number - confused!

Hi,

I am running the following test in Unity:
Render 125000 (yes, 125 thousand ) meshes and render the FPS and triangles on screen. The results are confusing and I would like to know why. If the meshes decrease in size, hence the number of rendered vertices decreases, the FPS drops… Results:
test1:125000 meshes, (size 707070 cubes, random filled with 0.83%) 169.4 million vertices, 10.3 FPS
test2:125000 meshes, (size 777 cubes, random filled with 61.9%), 10.5 million vertices, 3.8 FPS (!)

Then disabling Dynamic and Static batching, I get the same results:
test3:125000 meshes, (size 707070 cubes, random filled with 0.83%) 156.6 million vertices, 10.4 FPS
test4:125000 meshes, (size 777 cubes, random filled with 61.9%), 10.4 million vertices, 4.9 FPS (!)
test5:125000 meshes, (size 333 cubes, ), 2.7 million vertices, 5.0 FPS (!)

To be noted, there is only one graphic object in the whole scene and the meshes are the same mesh, drawn with Graphics.DrawMesh, in a 3d grid.
What is it that I get lower FPS with smaller meshes and fewer stuff drawn on the screen?

And a good question in the end:
Is it good to have a smaller number of meshes filled at max (65534 vertices per mesh) or a larger number and not filled at max? From my test here, the results are very confusing. It would seem that for the same number of meshes, having more vertices, increases the FPS…

Your information does not match the stats you post.
First of all you do not draw 125000 meshes each time. You might draw this number of cubes but the individual meshes (drawcalls) is different. You have ~2500 Batches for your first example. But you have over 100k(insane) Batches you draw in the second example. And the number of Batches equals the number of meshes I assume in your example.

The GPU can handle millions of vertices, but the capacity for drawcalls is limited. If you reach 2000 you should start to optimize your scenes.

1 Like

The code below must render 125000 meshes! That is what I use. Meshes have a size of 70x70x70 but only few cubes (so I don’t hit 65534) vertex limit. For now I fill the meshes with random positioned cubes.
P.S I do not understand why it would produce only around 2500 batches if the mesh size is 70x70x70 and full if the mesh is 7x7x7 . Any ideas?

``````    void Update()
{
for (int x = 0; x < 50; ++x)
{
for (int y = 0; y < 50; ++y)
{
for (int z = 0; z < 50; ++z)
{
Graphics.DrawMesh(VisualMesh, new Vector3(ChunkWidthX * x, ChunkWidthY * y, ChunkWidthZ * z), Quaternion.identity, material, 0);
}
}
}
}
``````