I searched the web to see if there are some math functions to test the CPU, and I use something like this
http://benchmarksgame.alioth.debian.org/u32/program.php?test=binarytrees&lang=lua&id=2
I turn off all the prints, and use code like this to print out the time difference before & after performing the math operations,
local cpu\_testing\_start = os.clock() timer.performWithDelay(0, function() testcpu() local diff = os.clock() - cpu\_testing\_start print("the diff=", diff) end)
And the diff for different devices I have:
-
iPhone 4S: 0.144026 ~ 0.181460
-
iPhone 5: 0.074126 ~ 0.088407
-
iPhone 5S: 0.041076 ~ 0.043670
-
iPad 4: 0.083305 ~ 0.089408
** Galaxy Tab 3 8.0 - 0.025328 ~ 0.045657
See, Galaxy Tab even has better result than 5S. Do you think my cpu testing has some flaw?
My app downloads 17 pictures from the Internet and save the images to a temporary folder and in between I use display.newImage() to show them with some UI effects (such as scaling & some icon movements)
From UI perspective, iPhone 5 & 5s is so smooth but Galaxy Tab is so laggy.
I use the cpu test result to decide what kind of restriction to put on. For example, how many concurrent UI effects can be executed at a time & the interval to perform each UI effect.