Skip to content

Instantly share code, notes, and snippets.

View stefanpenner's full-sized avatar
🎯
Focusing

Stefan Penner stefanpenner

🎯
Focusing
View GitHub Profile

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, { load } from "ember/component";
import ajax from 'ic-ajax';
export default Component.extend({
user: load(function(props) {
return ajax('/api/user');
}
});
// vs
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() {

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:

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"]
- [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

This document aims to help aggregate issues and solutions around the defaultContainer deprecation.

The Error Message:

Using the defaultContainer is no longer supported. [defaultContainer#lookup]

breaux, where's my defaultContainer?

Well it is still there, and will continue to work for some time. Likely it will be gone by 1.0.0 final

var asdf = {
initialize: function(user, controller) {
var delegate = (function(){
retun function(statusFromApi){
// controller reference from outer function
// is retained
controller.statusUpdate(statusFromApi)
};
})();
function bct(){
bundle list --paths | xargs /usr/local/bin/ctags -R *
}
function git-web-compare(){
# Usage:
# cd <git_repo>
# git-web-compare <user/repo>
# -> copies url into clipboard
# -> opens browser window at url
#
# Example:
# cd rails
# git-web-compare rails/rails