It looks like you're new here. If you want to get involved, click one of these buttons!
+ getDirection + getDistance + getAngleDifference + getXLenDir + getYLenDir + getXYLenDir + min + max + lerp + clamp |
--------------------------------------------------------- Testing "getDirection" implementation: (lua and C code 1000000 for/loop cycles) >> LUA TIME >>0.189142 >> C++ TIME >>0.11687599999999 on 1000000 cycles C++ Version is 38.207272842632% FASTER !!! --------------------------------------------------------- Testing "getDistance" implementation: (lua and C code 1000000 for/loop cycles) >> LUA TIME >>0.17260200000004 >> C++ TIME >>0.10276900000002 C++ Version is 40.458974982909% FASTER !!! --------------------------------------------------------- Testing "getAngleDifference" implementation: (lua and C code 1000000 for/loop cycles) >> LUA TIME >>0.18342899999999 >> C++ TIME >>0.091700000000003 C++ Version is 50.00790496595% FASTER !!! --------------------------------------------------------- Testing "getXLenDir" implementation: (lua and C code 1000000 for/loop cycles) >> LUA TIME >>0.15209499999997 >> C++ TIME >>0.089488999999958 C++ Version is 41.162431375145% FASTER !!! --------------------------------------------------------- Testing "getYLenDir" implementation: (lua and C code 1000000 for/loop cycles) >> LUA TIME >>0.15183300000001 >> C++ TIME >>0.095704999999953 C++ Version is 36.966930772661% FASTER !!! --------------------------------------------------------- Testing "getXYLenDir" implementation: (lua and C code 1000000 for/loop cycles) >> LUA TIME >>0.23478999999998 >> C++ TIME >>0.10216600000001 C++ Version is 56.486221730047% FASTER !!! --------------------------------------------------------- Testing "lerp" implementation: (lua and C code 1000000 for/loop cycles) >> LUA TIME >>0.091988000000015 >> C++ TIME >>0.092349000000013 C++ Version is 0.39244249249684% SLOVER !!! --------------------------------------------------------- Testing "clamp" implementation: (lua and C code 1000000 for/loop cycles) >> LUA TIME >>0.21178600000002 >> C++ TIME >>0.09044300000005 C++ Version is 57.295099770503% FASTER !!! |
Likes: SinisterSoft
Comments
https://deluxepixel.com
lua jit not tested because i have no access on it...
if you can try luajit i can sent you the beta of tnt collision lib and test...
(should be fine)
?
www.tntengine.com
https://deluxepixel.com
www.tntengine.com
https://deluxepixel.com
www.tntengine.com
main.lua is uploading.
Uploading finished.
---------------------------------------------------------
Testing "getDirection" implementation: (lua and C code 1000000 for/loop cycles)
>> LUA TIME >>0.060204999999996
>> C++ TIME >>0.50636499999996
on 1000000 cycles
C++ Version is 741.0680176065% SLOVER !!!
---------------------------------------------------------
Testing "getDistance" implementation: (lua and C code 1000000 for/loop cycles)
>> LUA TIME >>0.0020439999998416
>> C++ TIME >>0.28566299999989
C++ Version is 13875.684932584% SLOVER !!!
---------------------------------------------------------
Testing "getAngleDifference" implementation: (lua and C code 1000000 for/loop cycles)
>> LUA TIME >>0.3761770000001
>> C++ TIME >>0.21347800000012
C++ Version is 43.250650624555% FASTER !!!
---------------------------------------------------------
Testing "getXLenDir" implementation: (lua and C code 1000000 for/loop cycles)
>> LUA TIME >>0.0023140000000694
>> C++ TIME >>0.2540640000002
C++ Version is 10879.429558884% SLOVER !!!
---------------------------------------------------------
Testing "getYLenDir" implementation: (lua and C code 1000000 for/loop cycles)
>> LUA TIME >>0.001254999999901
>> C++ TIME >>0.24380999999994
C++ Version is 19327.091634994% SLOVER !!!
---------------------------------------------------------
Testing "getXYLenDir" implementation: (lua and C code 1000000 for/loop cycles)
>> LUA TIME >>0.0013020000001234
>> C++ TIME >>0.34724600000004
C++ Version is 26570.199690256% SLOVER !!!
---------------------------------------------------------
Testing "lerp" implementation: (lua and C code 1000000 for/loop cycles)
>> LUA TIME >>0.0018279999999322
>> C++ TIME >>0.213616
C++ Version is 11585.776805685% SLOVER !!!
---------------------------------------------------------
Testing "clamp" implementation: (lua and C code 1000000 for/loop cycles)
>> LUA TIME >>0.0016729999999825
>> C++ TIME >>0.24562199999991
C++ Version is 14581.530185444% SLOVER !!!
---------------------------------------------------------
Testing "circularClamp" implementation: (lua and C code 1000000 for/loop cycles)
>> LUA TIME >>0.0012669999998707
>> C++ TIME >>0.39937899999995
C++ Version is 31421.625891138% SLOVER !!!
https://deluxepixel.com
https://deluxepixel.com
so don't need to convert in c ?
there is a really BIG difference....
www.tntengine.com
Also to try it on iOS.
https://deluxepixel.com
yes.
if the differences are so big i think they works better in lua... than c...
under ios luaJIT is not possibile right ? but how if faster than standard lua system?
www.tntengine.com
On iOS because of the apple rules it has to be interpreted still (but still faster than normal Lua) - but on Android it gets recompiled into assembly (native!) code.
I use your collision routines even on Android because the code looks neater - I might just recode them as Lua routines though to see the difference.
There is also a different/easier? binding system for LuaJIT <=> C that you might want to look at - it might get rid of some of the bottleneck your C routines have.
https://deluxepixel.com
https://deluxepixel.com
... should be fine if you can make some test!
main bottleneck for little c function is that when you call a C function from lua code
ALL params are passed from lua to C and then from c to lua...
i think that luaJIT is the biggest (from my point of view) improvement that came to Gideros. next should be shaders...
but... where is @atilim ?
www.tntengine.com
https://deluxepixel.com
@MikeHart not yet but really soon to be
i can try and benchmark using luaJit now...
more info and tests coming soon....
if luaJIT is stable and fast enought (how seems to be)
we don't need native c code now...
so i can start to recode from scratch tnt particles 2 ...
Likes: SinisterSoft
www.tntengine.com
Android/Windows/Mac can use LuaJIT - the rest (iOS and possible Windows Phone 8 - or at this rate 9 ;p ) could use native...
https://deluxepixel.com
here is my test results...
the test are very simple... looping 1000000 same functions (first in lua then luaJIT and then C++ code).
result are strange... i know that luaJIT is beta but... here is the reults...
1. on Desktop LuaJIT outperform LUA and C++ code as showed by @SinisterSoft.
2. on DEVICE (iPhone 4S ios 7.0.6) LUA -LuAJIT same results (some millices differences some times better for lua some times better for LUAJIT... C++ code always faster 35-50%).
3. On Android... here is the strange part..
my test are done on QuadCore MTK6589 1.2Ghz andorid 4.2.1 STOCK rom.
i used standard Gideros Player + my TNT Collision LIB (c++)
and then the Gideros Player with modded LIBLUA (LUAJIT) provided with LuJIT package and my TNT Collision C++
LUA is Faster than LUAJIT (ALOT) and c++ is always faster.
here is some numbers...
---------------------------------------------------------
Testing "getDirection" implementation: (lua and C code 1000000 for/loop cycles)
>> LUA TIME >>0.12922200000003
>> LUAJIT TIME >>12.191781
>> C++ TIME >0.040789000000132
---------------------------------------------------------
Testing "getDistance" implementation: (lua and C code 1000000 for/loop cycles)
>> LUA TIME >>0.87321799999995
>> LUAJIT TIME >>8.404098
>> C++ TIME >>0.405303
---------------------------------------------------------
Testing "getAngleDifference" implementation: (lua and C code 1000000 for/loop cycles)
>> LUA TIME >>0.858746
>> LUAJIT TIME >>0.49382299999991
>> C++ TIME >>0.32814200000007
---------------------------------------------------------
Testing "getXLenDir" implementation: (lua and C code 1000000 for/loop cycles)
>> LUA TIME >>0.80873400000007
>> LUAJIT TIME >>11.890431
>> C++ TIME >>0.40018299999997
---------------------------------------------------------
Testing "getYLenDir" implementation: (lua and C code 1000000 for/loop cycles)
>> LUA TIME >>0.82719299999997
>> LUAJIT TIME >>12.070643
>> C++ TIME >>0.38011099999994
---------------------------------------------------------
Testing "getXYLenDir" implementation: (lua and C code 1000000 for/loop cycles)
>> LUA TIME >>1.290084
>> LUAJIT TIME >>12.559666
>> C++ TIME >>0.52168600000005
---------------------------------------------------------
Testing "lerp" implementation: (lua and C code 1000000 for/loop cycles)
>> LUA TIME >>0.470506
>> LUAJIT TIME >>11.67021
>> C++ TIME >>0.30802199999994
---------------------------------------------------------
Testing "clamp" implementation: (lua and C code 1000000 for/loop cycles)
>> LUA TIME >>1.018594
>> LUAJIT TIME >>8.364654
>> C++ TIME >>0.31064199999992
---------------------------------------------------------
Testing "circularClamp" implementation: (lua and C code 1000000 for/loop cycles)
>> LUA TIME >>1.590006
>> LUAJIT TIME >>13.071062
>> C++ TIME >>0.56435499999998
at this point...
1. is there something wrong in my device ?
2. LuaJIT is beta so on arm device is not so fast ?
LuaJIT on Android seems to be 10x slower that LUA.
it's strange...
but is alsto strange that on desktop luaJIT is 100x faster than c++ code...
what do you think...
i also tested "real" code (using oriented box to oriented box stess test 3 from my lib)
using 500 box...
on c++ code it takes 60-80 millisecs to render a frame...
on lua about 300-350 ms at frame...
lua jit.. 1300-1400ms at frame...
c++ (using luajit runtime) 900-1000ms at frame...
.... what do you think ?
:-B :-B :-B :-B :-B :-B
www.tntengine.com
Or is it possible lua and luajit binaries were mixed up?
about mixing lua and luaJIT binaries i'm sure that where not mixed (i generated 2 player and installed on my device).
here is the test source...
www.tntengine.com
As soon as I finish to code new test code I'll publish here there results with app so we can try on different devices.
Likes: hgvyas123
www.tntengine.com
https://deluxepixel.com
to deploy custom gideros player i do that: (as suggested some time ago from atilim)
1. create a new void project in gideors
2. export it.
3. remove asset folder.
3. now i replace liblua with luajit "liblua" in arv, arvv7 and x86 folder.
4. then i add my tnt lib and add it.
5. import on eclipse.
6. export and make an unsigned apk.
now. i'll recheck again...
there is something wrong...
www.tntengine.com
can you check your PM!
i sent you my gideros player apk.
can try to your device please ?
thanks.
i can't find where is my error....
www.tntengine.com
Just put it in that beta test folder on DropBox.
https://deluxepixel.com
www.tntengine.com
https://deluxepixel.com