News Roundup: JSPerf, Stratified Javascript, HTML5 goodies and more
JSPerf
JSPerf is an extremely awesome new way to create & share performance tests. The idea is simple: you provide a bit of HTML on which the code your testing will operate, and then add at least two alternative snippets to process that markup. You can then run the tests at the push of a button, and JSPerf will count the number of times per second that each snippet can execute. Once the tests are finished, the one with the most executions per second is the winner.
While Javascript benchmarking tools aren’t anything new, JSPerf stands out from the rest due to its ease of use, for sure, but also because of its collaborative features. Once someone creates a test, any other member of the community can go ahead and revise that test. For this reason, JSPerf has been called “the Github of performance testing”. While in practice, it might be more like a Pastie or Gist, the collaborative aspect is certainly there, and definitely sets JSPerf apart.
Under the hood, the benchmarking code is a modified version of JSLitmus, which we’ve looked at before in this space.
JSPerf makes it utterly trivial to write performance tests. Anytime you’re not sure which of a handful of methods will be more performant, you can quickly and easily settle the matter and get back to building stuff. Amazing work.
Stratified Javascript
How many times have you seen (or written) a method composed of more than a couple levels of nested asynchronous functions? If the answer is anything besides “never” (which, be honest, it is), you know what a pain it can be to keep track of your program’s flow. Well, if you were lucky enough to have been at the Emerging Languages Camp at OSCON in Portland last week, you might have seen this amazing presentation on Stratified Javascript, a framework for handling concurrency in Javascript.
Stratified JS runs on the Javascript implementation of the Oni language. It consists mostly in a few new Javascript language constructs that provide a straightforward way to manage concurrent and asynchronous processes.
For a more succinct overview of what Stratified JS has to offer, check out this blog post by its author.
A few quickies
- HTML5 innerShiv is a tool that lets you apply styles to dynamically-created HTML5 elements in browsers that don’t support HTML5 natively. There are already a few libraries out there that allow you to style HTML5 elements in older browsers (such as the HTML5shiv), but even those will fail when the HTML5 code is added after the page is loaded. HTML5 innerShiv is a workaround for this.
- Javascript “Pull to Refresh” – On mobile devices, an increasingly common UI pattern is to pull down on a list to refresh its contents (Tweetie/Twitter on iOS is the canonical example). This library allows you to include this behavior in browser-based UIs.
- Qooxdoo 1.2 is out, and while it’s probably not the kind of update that will turn the heads of folks who aren’t already using the library, it offers a handful of useful enhancements for Qooxdoo faithful. In addition to many bug fixes, there are several handy new utilities for generating documentation of Qooxdoo-based apps, among a few other changes.












