Status: New
Owner: ----
New issue 3759 by [email protected]: super slower then expected
https://code.google.com/p/v8/issues/detail?id=3759
Yes I know it's a set of micro benchmarks, so I apologize in advance if
something is funky.
Anyways today while comparing various ways to implement `super` or super
like functionality in JS, I noticed ES6 `super` and `toMethod` are slower
by comparison.
Given the class hierarchy of:
class Bar {
name() {
return 'bar';
}
};
class Foo extends Bar {
name() {
return 'foo' + super.name();
}
};
class Baz extends Foo {
name() {
return 'baz' + super.name();
}
};
full source:
https://github.com/stefanpenner/perf-scratch/blob/965070a1852f7d7daeededa92f3beb1770e5c8f8/super.js
runnable example: http://static.iamstef.net/super/
the micro benchmark numbers:
// es6 super
bar.name x 91,370,164 ops/sec ±2.39% (61 runs sampled)
foo.name x 9,165,519 ops/sec ±4.14% (58 runs sampled)
baz.name x 4,946,119 ops/sec ±3.47% (46 runs sampled)
// explicit manual inlining
bar.otherName x 94,934,476 ops/sec ±2.49% (60 runs sampled)
foo.otherName x 41,962,623 ops/sec ±2.94% (61 runs sampled)
baz.otherName x 23,638,438 ops/sec ±2.31% (61 runs sampled)
// Parent.prototype.method.call(..)
bar.traditionalName x 98,940,355 ops/sec ±3.45% (60 runs sampled)
foo.traditionalName x 73,616,189 ops/sec ±3.69% (61 runs sampled)
baz.traditionalName x 55,552,493 ops/sec ±3.62% (59 runs sampled)
// es6 toMethodName
bar.toMethodName x 97,245,227 ops/sec ±2.50% (60 runs sampled)
foo.toMethodName x 9,865,538 ops/sec ±3.03% (60 runs sampled)
baz.toMethodName x 5,172,785 ops/sec ±3.60% (59 runs sampled)
// ember style super via wrapping
bar.emberName x 98,860,284 ops/sec ±2.30% (60 runs sampled)
foo.emberName x 28,707,870 ops/sec ±2.81% (61 runs sampled)
baz.emberName x 14,306,060 ops/sec ±2.62% (60 runs sampled)
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.