squirrel 3.1's speed is faster Previous Topic Next Topic
 renshijun #1 Posted : Tuesday, January 3, 2017 12:04:47 PM(UTC) Rank: Advanced MemberGroups: Registered Joined: 12/26/2014(UTC)Posts: 30Location: Harbin, ChinaThanks: 1 timesWas thanked: 0 time(s) in 0 post(s) As the title says, it's faster than lua(not luajit). Back to top
 dane #2 Posted : Sunday, January 15, 2017 8:46:55 PM(UTC) Rank: NewbieGroups: Registered Joined: 1/15/2017(UTC)Posts: 1Location: daneThanks: 0 timesWas thanked: 0 time(s) in 0 post(s) It would be favorable that you post some evidence to back up your claim.I ran a small test of my own using Lua 5.3.3 (64 bit) and Squirrel 3.1 (64 bit). Here are the scripts and the outputs:.nutCode:class vec2 {    x = null;    y = null;        constructor(x, y) { this.x = x; this.y = y; }        function _mul(other) {return vec2(x * other.x, y * other.y); }};local operations = 10000000;local t = clock();local a = vec2(1, 1);local b = vec2(1, 1);for (local i = 0; i < operations; i++) {    local c = a * b;}t = clock() - t;println(format("[Squirrel3.1]: Time taken to perform %d operations: %.1fms", operations, t*1000));.luaCode:vec2 = {};function Vec2(x, y)    return setmetatable({x = x, y = y}, vec2)endfunction vec2.__mul(lhs, rhs) return Vec2(lhs.x * rhs.x, lhs.y * rhs.y); endfunction vec2.__tostring(v) return "(" .. v.x .. ", " .. v.y .. ")" endlocal operations = 10000000local t = os.clock()local a = Vec2(1, 1)local b = Vec2(1, 1)for i = 0, operations do    local c = a * bendt = os.clock() - t;print(string.format("[Lua 5.3.3]: Time taken to perform %d operations: %.1fms", operations, t*1000));Code:C:\Users\Dane\Desktop\lua-5.3.3>lua test.lua && sq test.nut[Lua 5.3.3]: Time taken to perform 10000000 operations: 5847.0ms[Squirrel3.1]: Time taken to perform 10000000 operations: 5990.0ms Back to top
 Kelvin #3 Posted : Friday, May 5, 2017 9:17:30 PM(UTC) Rank: Advanced MemberGroups: Registered Joined: 3/26/2015(UTC)Posts: 47Location: VAThanks: 3 timesWas thanked: 0 time(s) in 0 post(s) Wait, Lua can run Squirrel, too? Back to top
 Users browsing this topic Guest
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Clean Slate theme by Jaben Cargman (Tiny Gecko)