3 ms·
> there is essentially no performance difference between native functions and their JavaScript equivalents > native functions often have to cover complicated e
by dabernathy89 12y ago
> there is essentially no performance difference between native functions and their JavaScript equivalents
> native functions often have to cover complicated edge cases from the ECMAScript specification, which put them at a performance disadvantage.
Aren't these opposing statements?
- phpnode 12y agono, but I could probably have worded it better. What I mean to say is that if you do this in JS: function add (a, b) { return a + b; } and this in C: int add(int a,int b) { return a + b; } you're going to get essentially the same performance. The latter sentence you quoted refers to the specific builtin functions that fast.js re-implements. So we first get close to native performance in JS, then we beat the builtin functions by doing less work overall.
- dabernathy89 12y agogotcha, thanks for the clarification