bubble_shooter_2d/Assets/Mirror/Examples/BenchmarkPrediction
2025-06-01 09:14:39 +05:30
..
BallMaterial.mat mp init 2025-06-01 09:14:39 +05:30
BallMaterial.mat.meta mp init 2025-06-01 09:14:39 +05:30
MirrorPredictionBenchmark.unity mp init 2025-06-01 09:14:39 +05:30
MirrorPredictionBenchmark.unity.meta mp init 2025-06-01 09:14:39 +05:30
NetworkManagerPredictionBenchmark.cs mp init 2025-06-01 09:14:39 +05:30
NetworkManagerPredictionBenchmark.cs.meta mp init 2025-06-01 09:14:39 +05:30
PlayerSpectator.prefab mp init 2025-06-01 09:14:39 +05:30
PlayerSpectator.prefab.meta mp init 2025-06-01 09:14:39 +05:30
PredictedBall.prefab mp init 2025-06-01 09:14:39 +05:30
PredictedBall.prefab.meta mp init 2025-06-01 09:14:39 +05:30
RandomForce.cs mp init 2025-06-01 09:14:39 +05:30
RandomForce.cs.meta mp init 2025-06-01 09:14:39 +05:30
Readme.md mp init 2025-06-01 09:14:39 +05:30
Readme.md.meta mp init 2025-06-01 09:14:39 +05:30
WallMaterial.mat mp init 2025-06-01 09:14:39 +05:30
WallMaterial.mat.meta mp init 2025-06-01 09:14:39 +05:30

Mirror's PredictedRigidbody is optimized for low end devices / VR. While not interacting with the object, there's zero overhead! While interacting, overhead comes from sync & corrections.

This benchmark has predicted objects which are constantly synced & corrected. => This is not a real world scenario, it's worst case that we can use for profiling! => As a Mirror user you don't need to worry about this demo.

Benchmark Setup

  • Unity 2021.3 LTS
  • IL2CPP Builds
  • M1 Macbook Pro
  • vsync disabled in NetworkManagerPredictionBenchmark.cs

Benchmark Results History for 1000 objects without ghosts:

Not Predicted: 1000 FPS Client, 2500 FPS Server Predicted:
2024-03-13: 500 FPS Client, 1700 FPS Server 2024-03-13: 580 FPS Client, 1700 FPS Server // micro optimizations 2024-03-14: 590 FPS Client, 1700 FPS Server // UpdateGhosting() every 4th frame 2024-03-14: 615 FPS Client, 1700 FPS Server // predictedRigidbodyTransform.GetPositionAndRotation() 2024-03-15: 625 FPS Client, 1700 FPS Server // Vector3.MoveTowardsCustom() 2024-03-18: 628 FPS Client, 1700 FPS Server // removed O(N) insertion from CorrectHistory() 2024-03-28: 800 FPS Client, 1700 FPS Server // FAST mode prediction