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:
.nut
Code:
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));
.lua
Code:
vec2 = {};
function Vec2(x, y)
return setmetatable({x = x, y = y}, vec2)
end
function vec2.__mul(lhs, rhs) return Vec2(lhs.x * rhs.x, lhs.y * rhs.y); end
function vec2.__tostring(v) return "(" .. v.x .. ", " .. v.y .. ")" end
local operations = 10000000
local t = os.clock()
local a = Vec2(1, 1)
local b = Vec2(1, 1)
for i = 0, operations do
local c = a * b
end
t = 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