archwhite
2/19/2017 - 2:42 PM

phone benchmark / price calculation

phone benchmark / price calculation

# cpu, ux, 3d, total
# http://www.antutu.com/en/ranking/rank1.htm

benchmark_values_antutu = 
{
	"iPhone_7_Plus" => [48669, 61048, 59031, 181316],
	"iPhone_7" => [49702, 61137, 48474, 172001],
	"OnePlus3T" => [34510, 55414, 62341, 163013],
	"LeEco_Le_Pro3" => [33932, 51094, 62427, 159911],
	"Moto_Z" => [30891, 48323, 59088, 148820],
	"OnePlus3" => [31696, 44931, 59946, 147495],
	"Xiaomi_MI_5s" => [30257, 43526, 60022, 145093],
	"ASUS_Zenfone3" => [30741, 46102, 57334, 144610],
	"Xiaomi_MI_5s_Plus" => [33578, 45856, 53533, 143788],
	"ZTE_AXON_7" => [30857, 44087, 57641, 143463],
	"Google_Pixel_XL" => [32520, 44330, 56904, 141367],
	"Google_Pixel" => [32363, 44049, 56597, 140340],
	"LG_V20" => [29433, 43689, 55971, 139554],
	"LeEco_Le_MAX2" => [30649, 38720, 57870, 138953],
	"Sony_Xperia_XZ" => [29084, 43738, 57079, 138544],
	"iPhone_6s_Plus" => [41472, 48376, 39461, 138159],
	"LG_G5" => [30826, 40853, 54677, 136875],
	"Samsung_Galaxy_Note_7" => [35626, 43557, 47682, 136723],
	"Huawei_Mate_9" => [33261, 44276, 46997, 135622],
	"Samsung_Galaxy_S7_Edge" => [27707, 41505, 55792, 135261],
	"iPhone_6s" => [41256, 49651, 35902, 135248],
	"Xiaomi_MI_5" => [30459, 40327, 53515, 134917],
	"ZUK_Z2" => [31359, 35322, 56940, 134172],
	"HTC_10" => [28536, 37666, 55914, 133310],
	"iPhone_SE" => [41898, 49552, 32535, 132807],
	"Nubia_Z11" => [30823, 32093, 58179, 131770],
	"Sony_Xperia_X_Performance" => [27578, 36602, 54177, 126543],
	"HTC_One_M9" => [21125, 52335, 27035, 106036],
	"Google_Nexus_9" => [29424, 35496, 25842, 98847],
	"Meizu_PRO_6" => [29521, 41667, 19230, 97755],
	"Huawei_P9" => [34516, 36516, 17665, 94117],
	"Huawei_P9_Plus" => [33461, 36761, 17429, 93896],
	"NVIDIA_Shield_Tablet_K1" => [24171, 25218, 36975, 93413],
	"Huawei_Honor_8" => [32413, 35319, 18420, 92348],
	"LeEco_Le_2" => [27221, 39837, 17991, 92305],
	"Huawei_Mate_8" => [32911, 33224, 18631, 91024],
	"Meizu_MX6" => [27959, 37881, 17829, 90819],
	"Redmi_Pro" => [26373, 38622, 18311, 90760],
	"Sony_Xperia_Z4_Tablet" => [23308, 29223, 31459, 89973],
	"Moto_X_Force" => [23055, 28839, 32247, 89697],
	"Vernee_Apollo_Lite" => [27935, 35731, 18047, 88823],
	"LeEco_Le_Pro" => [22016, 27833, 31805, 87787],
	"Google_Nexus_6P" => [22126, 30676, 29497, 87270],
	"LeEco_MAX" => [22741, 25816, 31944, 86363],
	"Samsung_Galaxy_S6_Edge" => [25906, 29059, 24327, 85236],
	"Sony_Xperia_Z5" => [21562, 26137, 32087, 84998],
	"Meizu_PRO_5" => [26654, 28501, 22119, 84081],
	"Samsung_Galaxy_A8" => [25529, 28248, 23554, 83919],
	"Redmi_Note_4" => [25577, 35318, 15524, 83351],
	"iPhone_6_Plus" => [27006, 24266, 24882, 83289]
}

phone_prices = \
{
	"OnePlus3"=> 24350,
	"OnePlus3T"=> 29700,
	"Redmi_Note_4"=> 11330,
	"ASUS_Zenfone3"=> 19195,
	"Xiaomi_MI_5"=> 15230,
	"Xiaomi_MI_5s"=> 18950,
	"Redmi_Pro"=> 12950,
	"iPhone_7"=> 38790,
	"iPhone_7_Plus"=> 46390,
	"LeEco_Le_Pro3"=> 26000
}

result_cpu = {}
result_ux = {}
result_3d = {}
result_total = {}

phone_prices.each do |pp|
	vendor = pp[0]
	price = phone_prices[vendor]

	result_cpu[vendor]   = benchmark_values_antutu[vendor][0] / price.to_f
	result_ux[vendor]    = benchmark_values_antutu[vendor][1] / price.to_f
	result_3d[vendor]    = benchmark_values_antutu[vendor][2] / price.to_f
	result_total[vendor] = benchmark_values_antutu[vendor][3] / price.to_f
end

result_cpu = 	result_cpu.sort_by 	 {|_key, value| value}
result_ux = 	result_ux.sort_by 	 {|_key, value| value}
result_3d = 	result_3d.sort_by 	 {|_key, value| value}
result_total = 	result_total.sort_by {|_key, value| value}

p('SORTED RESULTS, RIGHTER IS BETTER:')
print "\nresult_cpu = ";   result_cpu.each {|x| print "#{x[0]}, "}
print "\nresult_ux = ";    result_ux.each {|x| print "#{x[0]}, "}
print "\nresult_3d = ";    result_3d.each {|x| print "#{x[0]}, "}
print "\nresult_total = "; result_total.each {|x| print "#{x[0]}, "}

print("\n\nALL VALUES:\n")
print "\nresult_cpu = ";	print(result_cpu)
print "\nresult_ux = ";	 	print(result_ux)
print "\nresult_3d = ";	 	print(result_3d)
print "\nresult_total = ";	print(result_total)
# cpu, ux, 3d, total
# http://www.antutu.com/en/ranking/rank1.htm

benchmark_values_antutu = \
{
	"iPhone_7_Plus" : [48669, 61048, 59031, 181316],
	"iPhone_7" : [49702, 61137, 48474, 172001],
	"OnePlus3T" : [34510, 55414, 62341, 163013],
	"LeEco_Le_Pro3" : [33932, 51094, 62427, 159911],
	"Moto_Z" : [30891, 48323, 59088, 148820],
	"OnePlus3" : [31696, 44931, 59946, 147495],
	"Xiaomi_MI_5s" : [30257, 43526, 60022, 145093],
	"ASUS_Zenfone3" : [30741, 46102, 57334, 144610],
	"Xiaomi_MI_5s_Plus" : [33578, 45856, 53533, 143788],
	"ZTE_AXON_7" : [30857, 44087, 57641, 143463],
	"Google_Pixel_XL" : [32520, 44330, 56904, 141367],
	"Google_Pixel" : [32363, 44049, 56597, 140340],
	"LG_V20" : [29433, 43689, 55971, 139554],
	"LeEco_Le_MAX2" : [30649, 38720, 57870, 138953],
	"Sony_Xperia_XZ" : [29084, 43738, 57079, 138544],
	"iPhone_6s_Plus" : [41472, 48376, 39461, 138159],
	"LG_G5" : [30826, 40853, 54677, 136875],
	"Samsung_Galaxy_Note_7" : [35626, 43557, 47682, 136723],
	"Huawei_Mate_9" : [33261, 44276, 46997, 135622],
	"Samsung_Galaxy_S7_Edge" : [27707, 41505, 55792, 135261],
	"iPhone_6s" : [41256, 49651, 35902, 135248],
	"Xiaomi_MI_5" : [30459, 40327, 53515, 134917],
	"ZUK_Z2" : [31359, 35322, 56940, 134172],
	"HTC_10" : [28536, 37666, 55914, 133310],
	"iPhone_SE" : [41898, 49552, 32535, 132807],
	"Nubia_Z11" : [30823, 32093, 58179, 131770],
	"Sony_Xperia_X_Performance" : [27578, 36602, 54177, 126543],
	"HTC_One_M9" : [21125, 52335, 27035, 106036],
	"Google_Nexus_9" : [29424, 35496, 25842, 98847],
	"Meizu_PRO_6" : [29521, 41667, 19230, 97755],
	"Huawei_P9" : [34516, 36516, 17665, 94117],
	"Huawei_P9_Plus" : [33461, 36761, 17429, 93896],
	"NVIDIA_Shield_Tablet_K1" : [24171, 25218, 36975, 93413],
	"Huawei_Honor_8" : [32413, 35319, 18420, 92348],
	"LeEco_Le_2" : [27221, 39837, 17991, 92305],
	"Huawei_Mate_8" : [32911, 33224, 18631, 91024],
	"Meizu_MX6" : [27959, 37881, 17829, 90819],
	"Redmi_Pro" : [26373, 38622, 18311, 90760],
	"Sony_Xperia_Z4_Tablet" : [23308, 29223, 31459, 89973],
	"Moto_X_Force" : [23055, 28839, 32247, 89697],
	"Vernee_Apollo_Lite" : [27935, 35731, 18047, 88823],
	"LeEco_Le_Pro" : [22016, 27833, 31805, 87787],
	"Google_Nexus_6P" : [22126, 30676, 29497, 87270],
	"LeEco_MAX" : [22741, 25816, 31944, 86363],
	"Samsung_Galaxy_S6_Edge" : [25906, 29059, 24327, 85236],
	"Sony_Xperia_Z5" : [21562, 26137, 32087, 84998],
	"Meizu_PRO_5" : [26654, 28501, 22119, 84081],
	"Samsung_Galaxy_A8" : [25529, 28248, 23554, 83919],
	"Redmi_Note_4" : [25577, 35318, 15524, 83351],
	"iPhone_6_Plus" : [27006, 24266, 24882, 83289]
}

phone_prices = \
{
	"OnePlus3": 24350,
	"OnePlus3T": 29700,
	"Redmi_Note_4": 11330, # 11550
	"ASUS_Zenfone3": 19195,
	"Xiaomi_MI_5": 15230, # 15300
	"Xiaomi_MI_5s": 18950, # 21490
	"Redmi_Pro": 12950,
	"iPhone_7": 38790,
	"iPhone_7_Plus": 46390,
	"LeEco_Le_Pro3": 26000
}

result_cpu = {}
result_ux = {}
result_3d = {}
result_total = {}

for vendor, price in phone_prices.items():
    result_cpu[vendor]   = benchmark_values_antutu[vendor][0] / price
    result_ux[vendor]    = benchmark_values_antutu[vendor][1] / price
    result_3d[vendor]    = benchmark_values_antutu[vendor][2] / price
    result_total[vendor] = benchmark_values_antutu[vendor][3] / price

sresult_cpu   = sorted(result_cpu, 	 key= lambda x:  result_cpu[x])
sresult_ux 	  = sorted(result_ux, 	 key= lambda x:  result_ux[x])
sresult_3d 	  = sorted(result_3d, 	 key= lambda x:  result_3d[x])
sresult_total = sorted(result_total, key= lambda x:  result_total[x])

print('SORTED RESULTS, RIGHTER IS BETTER:')

print('result_cpu = ', 	 sresult_cpu)
print('result_ux = ',  	 sresult_ux)
print('result_3d = ',  	 sresult_3d)
print('result_total = ', sresult_total)

print('\n\nALL VALUES:\n')

print('result_cpu = ', 	 [(k, result_cpu[k]) for k in sresult_cpu])
print('result_ux = ',  	 [(k, result_ux[k]) for k in sresult_ux])
print('result_3d = ',  	 [(k, result_3d[k]) for k in sresult_3d])
print('result_total = ', [(k, result_total[k]) for k in sresult_total])