lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 7/9/13, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
>> That's awesome! Is that benchmark program public? I'm curious if armv7
>> based iOS and Android devices will show the same behavior.
>
> It was not anything serious; but I am attaching them to this message.
> The only one I changed for Lua 3.0 was the heapsort, where I added
> the "floor = math.ifloor or floor" line.
>
> -- Roberto

Here are my results on an iPad mini. (It looks like there is some difference.)

Using clang -Os
long long (3), double (2)
Elapsed time for RunAck is (ms) 	1569
Elapsed time for RunHeapSort is (ms) 	720
Elapsed time for RunMandel is (ms) 	43499
Elapsed time for RunMatrix is (ms) 	85

long (2), double (2)
Elapsed time for RunAck is (ms) 	1513
Elapsed time for RunHeapSort is (ms) 	647
Elapsed time for RunMandel is (ms) 	43234
Elapsed time for RunMatrix is (ms) 	75

long (2), float (1)
Elapsed time for RunAck is (ms) 	1273
Elapsed time for RunHeapSort is (ms) 	598
Elapsed time for RunMandel is (ms) 	41538
Elapsed time for RunMatrix is (ms) 	70


Using clang -Ofast -fvectorize -ffast-math -flto

long long (3), double (2)
Elapsed time for RunAck is (ms) 	1638
Elapsed time for RunHeapSort is (ms) 	689
Elapsed time for RunMandel is (ms) 	40664
Elapsed time for RunMatrix is (ms) 	80

long (2), double (2)
Elapsed time for RunAck is (ms) 	1497
Elapsed time for RunHeapSort is (ms) 	649
Elapsed time for RunMandel is (ms) 	41764
Elapsed time for RunMatrix is (ms) 	76

long (2), float (1)
Elapsed time for RunAck is (ms) 	1277
Elapsed time for RunHeapSort is (ms) 	531
Elapsed time for RunMandel is (ms) 	37805
Elapsed time for RunMatrix is (ms) 	58


Also, I spot checked a few function call overhead benchmarks (since I
was doing that recently against Lua 5.1 (double) to compare to some
other languages). It looks like the size may have an impact even when
numbers are not directly involved. (Note: My optimization flags are a
little different. 5.1 was -Os, while 5.3.w0 was -Ofast -fvectorize
-ffast-math -flto.)

Calling an Empty Lua Function from Lua:
Lua 5.1.5: 0.3370 microseconds per call
Lua 5.3.w0 with long long (3), double (2):  0.3773 microseconds per call
Lua 5.3.w0 with long (2), float (1):  0.2887 microseconds per call

Calling an Empty C Function from Lua:
Lua 5.1.5: 0.2332 microseconds per call
Lua 5.3.w0 with long long (3), double (2):  0.2607 microseconds per call
Lua 5.3.w0 with long (2), float (1):  0.1989 microseconds per call

Calling a no parameter C Function from Lua that returns a double :
Lua 5.1.5: 0.2503 microseconds per call
Lua 5.3.w0 with long long (3), double (2):  0.2759 microseconds per call
Lua 5.3.w0 with long (2), float (1):  0.2148 microseconds per call

Calling a single parameter (double) C Function from Lua:
Lua 5.1.5: 0.3033 microseconds per call
Lua 5.3.w0 with long long (3), double (2):  0.3578 microseconds per call
Lua 5.3.w0 with long (2), float (1):  0.2637 microseconds per call


Thanks,
Eric
-- 
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/