Skip to content

Instantly share code, notes, and snippets.

View stefanpenner's full-sized avatar
🎯
Focusing

Stefan Penner stefanpenner

🎯
Focusing
View GitHub Profile
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
- [All thenable 100] platform (chrome 37) x 895 ops/sec ±36.14% (38 runs sampled)
- [All thenable 100] when x 66,870 ops/sec ±4.19% (44 runs sampled)
- [All thenable 100] bluebird x 22,747 ops/sec ±11.24% (39 runs sampled)
- [All thenable 100] q x 271 ops/sec ±40.11% (20 runs sampled)
- [All thenable 100] rsvp-2.0.4 x 125 ops/sec ±23.10% (20 runs sampled)
- [All thenable 100] rsvp-3.0.0 x 1,393 ops/sec ±47.54% (25 runs sampled)
- [All thenable 100] rsvp x 54,020 ops/sec ±8.18% (35 runs sampled) <-- current spike
Running Benchmark Suite for test - All 100 ... promise_benchmarks.amd.js:239
- [All 100] platform x 1,216 ops/sec ±5.37% (48 runs sampled) promise_benchmarks.amd.js:198
- [All 100] when x 180,066 ops/sec ±8.18% (49 runs sampled) promise_benchmarks.amd.js:198
- [All 100] bluebird x 59,565 ops/sec ±7.04% (48 runs sampled) promise_benchmarks.amd.js:198
- [All 100] q x 449 ops/sec ±11.33% (40 runs sampled) promise_benchmarks.amd.js:198
- [All 100] rsvp x 197,047 ops/sec ±6.65% (48 runs sampled) promise_benchmarks.amd.js:198
Fastest for All 100 is ["rsvp"]

Keybase proof

I hereby claim:

  • I am stefanpenner on github.
  • I am stefanpenner (https://keybase.io/stefanpenner) on keybase.
  • I have a public key whose fingerprint is EC5C D237 8064 3984 BFF9 C0FF 0839 E05D 8DEA 0857

To claim this, I am signing this object:

promise = new Promise(funciton(resolve, reject) {
setTimeout(function() {
// good practice to run-loop here, but not totally required. Just for extra perf/consistency
Ember.run(null, resolve, 'fullfillment value');
})
})
// this queues a task to flush later, so it requires the run-loop
// in testing on master ember (Ember.testing = true) we just do it for you
promise.then(function() {
import Component, { load } from "ember/component";
import ajax from 'ic-ajax';
export default Component.extend({
user: load(function(props) {
return ajax('/api/user');
}
});
// vs

testing various super mechanism including es6 super in 41.0.2249.0 canary (64-bit) Looks like es6 super needs some perf tuning.

// 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)
import Component from 'ember/component';
export default Component.extend({
queryParams: Ember.inject.service('query-params'),
sortOrder: Ember.computed.alias('queryParams.sortOrder')
})
[alias]
pr = "!f() { git fetch origin refs/pull/$1/head:pr-$1 && git checkout pr-$1; } ; f"

so given:

var a = {
  @myDecorator('someValue') name
};

if name is not defined, what should happen. Should it always throw, or only throw if myDecorator attempts to access descriptor.value?