If i have a piece of code(run a billion times vector3.distance) that will take 1 second to complete running in PC, 10 seconds to complete in both mobile devices(each).
Does it mean no matter whatever code i change to, PC will always approximately 10x faster than any of the mobile devices ?
No, it will vary depending on what you are doing, if you are using platform specific assets or code and which platform, device, os and device type. Too many variables to generalize.
Simple answer, test. Build a test that replicates the big things and try it out.
Did a simple test, i dont have a ios device so ill share my result for pc and android device
Run 10 million times of sqrMagnitude, magnitude, angle, and distance
PC takes 366, 492, 1973, 393 miliseconds
Android(Note2) takes 2239, 10512, 27106, 10147 miliseconds
Ratio 6.1, 21.4, 13.7, 25.8
using UnityEngine;
using System.Collections;
using System.Diagnostics;
using TMPro;
public class TestPerformance : MonoBehaviour {
public TextMeshPro pfText;
// Use this for initialization
void Start () {
int intCount = 10000000;
int intCount2;
string strDisplay = "";
Vector3[] v3A = new Vector3[intCount];
Vector3[] v3B = new Vector3[intCount];
float[] fltAnswer = new float[intCount];
Stopwatch sw1;
for (intCount2 = 0; intCount2 < intCount; intCount2++) {
v3A[intCount2] = new Vector3(Random.Range(0f,10f), Random.Range(0f,10f), Random.Range(0f,10f));
v3B[intCount2] = new Vector3(Random.Range(0f, 10f), Random.Range(0f, 10f), Random.Range(0f, 10f));
}
sw1 = Stopwatch.StartNew();
for (intCount2 = 0; intCount2 < intCount; intCount2++) {
fltAnswer[intCount2] = (v3A[intCount2]-v3B[intCount2]).sqrMagnitude;
}
strDisplay += "10 mil x sqrMagnitude = " + sw1.ElapsedMilliseconds.ToString() + "\n";
sw1 = Stopwatch.StartNew();
for (intCount2 = 0; intCount2 < intCount; intCount2++) {
fltAnswer[intCount2] = (v3A[intCount2] - v3B[intCount2]).magnitude;
}
strDisplay += "10 mil x magnitude = " + sw1.ElapsedMilliseconds.ToString() + "\n";
sw1 = Stopwatch.StartNew();
for (intCount2 = 0; intCount2 < intCount; intCount2++) {
fltAnswer[intCount2] = Vector3.Angle(v3A[intCount2], v3B[intCount2]);
}
strDisplay += "10 mil x Angle = " + sw1.ElapsedMilliseconds.ToString() + "\n";
sw1 = Stopwatch.StartNew();
for (intCount2 = 0; intCount2 < intCount; intCount2++) {
fltAnswer[intCount2] = Vector3.Distance(v3A[intCount2], v3B[intCount2]);
}
strDisplay += "10 mil x Distance = " + sw1.ElapsedMilliseconds.ToString() + "\n";
pfText.text = strDisplay;
}
}
There are lots of different kinds of all 3 devices, so no you can’t generalize that about performance. In general mobile devices are slower than PCs, but that’s because mobile devices usually have lesser CPU/GPU/RAM and there is no single ratio that applies to all devices.
What specifications for your PC? What Android device? Not all devices are going to perform the same and my $10 Android phone is a testament to that fact.
Arbitrary benchmarks are pretty useless in the practical sense. How devices/platforms handle your requirements isn’t going to be revealed by simply looping processes or throwing a bunch of stuff on the screen. Yea, a generic PC is probably faster than a mid range handheld. You can’t say much more than that. How they handle specific things like physics, images, large images, networking, memory swapping, etc, etc… can only be determined by testing those aspects.