Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Bare Metal Coding

Bare Metal Coding

A 15-minute talk on improving performance in web apps and games.

See a video of the presentation here: http://video.kiberpipa.org/jsmeet_slavic_performance_optimizing/

Klemen Slavič

April 30, 2013
Tweet

More Decks by Klemen Slavič

Other Decks in Programming

Transcript

  1. HI.

  2. RULE #7 function Person(firstName, lastName) { this.firstName = firstName; this.lastName

    = lastName; } Person.prototype.sayHello = function() { alert("Hello, I'm " + this.firstName); }; var jack = new Person('Jack', 'Sparrow'); jack.sayHello();
  3. RULE #8 (CONTINUED) // immutable vector implementation function Vec2d(x, y)

    { this.x = x; this.y = y; } Vec2d.prototype.add = function(x, y) { if (x instanceof Vec2d) { y = x.y; x = x.x; } return new Vec2d(this.x + x, this.y + y); }; var a = new Vec2d(1,2), b = new Vec2d(3,4); for (var i = 0; i < 1e7; i++) a = a.add(b);