Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
100x slower performance for numeric operations via method ['$+'] vs native operation. #534
Check this jsperf which compares native JS numeric operation for addition :
There's no way to get around this I think without providing optional type annotations to opal... something like:
def add(a : Number, b : Number) a + b end
And the compiler would know to use native operations for variables that have given Number (or other compatible) types. I guess like the crystal compiler.