SitePen Blog Category ‘Performance’

String Performance: an Analysis May 9th, 2008 at 12:02 am by Tom Trenka

Recently I was writing a “tips and tricks” blog post that was going to focus on the idea that it is better to use an object as a “string buffer”; the idea was that by passing this object around to various functions and pushing string fragments into it, you can get better performance from a JavaScript engine. My friend and colleague Alex Russell challenged me to show him hard data supporting this hypothesis—and the results were quite eye-opening!

String performance by browser

(more…)

Dojo-Mini: Optimization Tricks with the Dojo Toolkit April 2nd, 2008 at 2:02 pm by Peter Higgins

The Dojo Toolkit 1.1 introduces support to run within Adobe’s AIR environment, and I think it may have re-sparked my interest in ActionScript. It was a lot easier than I had anticipated to get started coding, but came to a halt when it occurred to me that my newly created .air installer and badge would be at best a ~5MB download simply because of the default release size. A 5MB “Hello AIR” app is less than unimpressive, so I immediately started thinking of ways to better the situation. I need a custom minified Dojo Toolkit package.

Initial Distribution

Enter “dojo-mini” - an experiment in Dojo Toolkit deployment optimization. When Alex tagged the release, I immediately downloaded it, dropped it in as the toolkit for my upcoming AIR Demo and began browsing the source making a mental list of crufty files I could drop to shave some bytes away. I was amazed with my results:

(more…)

Why Apple is Investing in WebKit Performance March 24th, 2008 at 10:51 pm by Kevin Dangoor

Today, I was eating lunch alone at a restaurant and reading some news via my iPhone’s EDGE connection. Suddenly, Surfin’ Safari - Blog Archive » Optimizing Page Loading in the Web Browser made even more sense.

Apple has been putting actual dollars into making Safari and the underlying open source WebKit really, really fast. Safari 3 is significantly faster than Safari 2. There was another big speed boost after Safari 3.0.

(more…)

Dojo Storage and Dojo Bling March 14th, 2008 at 1:48 pm by Dylan Schiemann

There was a lot of activity in the Dojo Toolkit community this week, including an update for Dojo Storage plus articles on productivity and writing DRYer code.

(more…)

Mobile Gears could help network latency March 5th, 2008 at 4:54 pm by Jason Cline

Mobile application development has many challenges. The announcement of Google Gears on Mobile Devices will help solve the problems of network connectivity, network latency, and limited bandwidth. On the desktop, a lot of the focus on Gears was its ability to allow applications to function when your computer was not connected to the network. In addition to building mobile web apps here at SitePen, we released Dojo Offline, which integrates the Dojo Toolkit with Gears to make building disconnected web applications even easier. As we all know, mobile devices lose connectivity with the network on a regular basis. Gears’ ability to keep the data that users need stored on the phone will be key to keeping mobile applications running even when networks fail to keep phones connected.

(more…)

Dealing with the Flexibility of JavaScript October 14th, 2007 at 3:56 pm by Neil Roberts

This is a continuation of my previous post A Fine Line Between Abstraction and Obfuscation and, of course, deals with the same material.

JavaScript is flexible in almost every way, and many people end up either abusing the flexibility, or creating strategies of overcoming the flexibility that only create confusion and messy code. I’d like to go over one of my favorite topics today, JavaScript’s function signature, although lack of a function signature is probably a better way to say it. You’ll see that can employ some strategies that can solve these problems without increasing the amount of code you have, while at the same time, providing context for those using your code in the future. Even if you don’t use everything I’m setting out below, I hope it will reveal what to be cautious of, and help you create meaningful solutions of your own.

(more…)

A Fine Line Between Abstraction and Obfuscation September 24th, 2007 at 9:09 pm by Neil Roberts

Introduction to Part 1

By the time you have written your abstraction layer, you have essentially written your own framework. Chances are, you are not a good framework writer, and it’s going to suck, and you are going to realize that one or two versions down the road and re-write it. © RedMonk in Java’s Fear of Commitment.

While there is a lot written on how difficult it is to write a good abstraction layer, there is very little advice on how to avoid the worst evil of the abstraction layer: obfuscation. As I scoured the internet looking for any discussion on this topic, my search results were a lot more sparse than I was expecting. There is a very succinct blog entry by Rhett Maxwell that turned up in my results that summarizes some of what I’d like to say in a single sentence: Most of the books out there that teach OO design talk about Abstraction, but they do not warn about Obfuscation at all. Its a shame.

And to those of you wondering why this type of obfuscation is a problem, let me clear it up. Obfuscation at its most harmless simply confuses people. Obfuscation at its worst makes people stupid. When the most brilliant programmer can no longer figure out how to get from point A to B, even though they are right next to each other, all their genius is useless.

JavaScript is incredibly susceptible to becoming accidentally obfuscated. In the next month or so, I want to go over various common methods of abstraction that I have seen widely used in JavaScript and discuss how and why they can lead to obfuscation.
(more…)

The Dojo Grid September 16th, 2007 at 9:58 pm by Dylan Schiemann

The single, most asked question with the Dojo 0.9 release has been, “Where’s the grid widget?” We’re finally able to address this request with today’s announcement that SitePen, Mozilla Foundation, Nexaweb Technologies, Redfin, & SnapLogic Announce Open Source Contribution of TurboAjax Group’s High-Performance Grid Widget to Dojo Foundation.

For those of you familiar with the existing TurboGrid widget, you’ll be happy to know that the same great performance and feature set are currently being ported to the 1.0 codebase, with support for Dijit and all of the great features Dijit offers (CSS theming, a11y, il8n, dojo.data, etc.).

(more…)

Dojo 0.9 Update: M2 May 13th, 2007 at 11:18 pm by Alex Russell

This past Friday, we pushed Dojo 0.9 Milestone Release 2 out of the nest. This is the last milestone before Beta and the system is starting to take a recognizable shape. Only thinner.

Here’s what’s new and awesome in M2:

  • Dijit has landed! Holy cow is it fast. Stay tuned for themes and more widgets.
  • Layered builds. Slice and dice your builds any way you like to achieve maximum performance
  • Style code is now even faster
  • Lots of new modules, bug fixes, and quality APIs

(more…)

Writing RPM packages is easier than you might think March 10th, 2007 at 12:38 am by Torrey Rice

Hello,

Writing RPM packages seems to intimidate some, but it can be easier than you might guess. Below, I will:

  • point out the online reference RPM documentation
  • describe one method of configuring a build environment
  • outline a simple specfile (sysreport package)
  • describe the process of building the package from the specfile
  • introduce a few convenient RPM macros

Here are a few terms:

  • specfile a file containing the rules for building an RPM package
  • RPM the distributable package intended for the target
  • SRPM a special package containing all the source code and the specfile for a given package
  • rpm the command-line program used for installing packages
  • rpmbuild the command-line program used for building packages

(more…)