Dennis Forbes on Software and Technology   Subscribe to RSS


About the Author
Dennis Forbes Dennis Forbes is a Toronto-based software architect. While focused primarily on the .NET and SQL Server worlds, Dennis frequently ventures outside of this comfort zone into game development and image processing. He has been published in several industry magazines, has been quoted in the Wall Street Journal and has been interviewed by NPR.

He is a vice president and lead software architect at an innovative New York City hedge fund back-office services firm.

Dennis has been working on solutions for the financial, telecommunications, and power generation markets for over 15 years.




The Feed Bag
Feb 24 - TED

 
Thursday, January 21 2010

The NAS Gets a New PSU

In March of last year I wrote about replacing the home NAS with a custom-built Linux box.  

Almost a year in and the device has served the purpose well, providing a solid foundation for a connected home. I’ve been very satisfied with the change.

The only downsides of the unit are the higher power consumption (averaging around 38W), and the groan of the two fans inside: the power supply and chipset fans. The audible part isn’t really an issue given that it’s stashed away, but considering that a probable failure point on most new electronics is the fans, it becomes a reliability concern.

I junked a laptop because of an impossible to repair broken fan. I’ve lost several video cards for the same reason.

I can even hear the irritating whirring of my blu-ray player’s fan (do not buy the Samsung BDP1600. The thing is complete junk even without factoring in the noisy fan trying to upstage the even noisier optical unit. Speaking of junk, the Sony alpha-200 is another garbage product that made me regret ever turning my back on Canon).

As promised in the original entry, I got around to replacing the power supply with a PicoPSU 90W unit, which was basically a plug and play swap.

In my original entry I estimated a 4-8W power reduction, which turned out to be an underestimation. With this PSU the power consumption dropped a whole 10W, going down to a constant 28W (only slightly spiking under load), making me feel a little less enviro-guilt. There’s still the noisy chipset fan, but that’ll be another project.

The case was built around the expectation of a power supply fan exhausting heat, so some extra natural ventilation was required. With that the sensor readings now hover at low operating levels.

Economically this is a change that will not pay off. From NCIX the new PSU cost me $73.49 all in. Given a savings of 0.01kWh per hour, and a fully loaded electric cost around $0.16/kWh, it would take 5 years for the 10W to pay for the change.

It would be nice if all power supplies were mandated to be efficient (they aren’t for most devices because they know it plays zero part in your purchasing criteria. It’s unfortunately one of those areas where legislation is really the only effective solution), because right now inefficiency is the standard. Of course environmental choices don't always yield the expected results.

The Dream is Over...Wake Up With New Phone

In July of last year I wrote about choosing a new smartphone to replace the MotoQ that I had been using. While the MotoQ served a good tour of duty, it was seriously showing its age and was falling behind in the empowering mobile revolution.

While I’d been using variants of Windows CE since before the turn of the century, Windows Mobile was obviously lost in the wilderness. Not only was each equipped device essentially abandoned right after being released, the clearest sign that Microsoft lost the plot could be seen in PocketIE, where the preloaded bookmarks to various Microsoft Mobile pages led to 404 errors.

The team moved onto something new and shiny and had no concern at all for the existing base. Microsoft has a very short attention span to products that don't earn them Windows Office type revenue numbers, so it wasn't a surprise.

For various reasons I did not want an iPhone (we don’t need another restrictive and innovation crushing Microsoft scenario playing out, and I want to develop for the device without embracing the whole cult), despite it being the easy choice. I opined in the first entry that Android seemed to have a very bright future ahead, which is a prediction that seems quite obvious now given that it is the platform of so many incredible devices recently released or on the horizon.

The future is so bright for Android that the robots have to wear shades.

The options in Canada were (and remain) limited, so I went with an HTC Dream (G1) given that it had a keyboard and otherwise had largely the same specs as the newer HTC Magic, aside from what seemed like a minor difference in memory capacity.

 I have to confess to being disappointed with the device.

Functionally it is amazing, and even with Android 1.5 the platform is simply brilliant. When everything operates correctly I am over the moon with the device.

The problem is that everything didn’t operate correctly. For whatever reason the device seems to be horrendously overloaded, so even with virtually no apps installed and nothing beyond the base system running, most actions are plagued by obnoxious pauses, even on a fresh start-up.

I hate pauses.

I stopped using brilliant apps like Weatherbug because they seemed to make the situation worse.

Alas, my long term plan was always that I would buy one of the newer, faster phones when they came to market, while using the starter device for development purposes until that time. If an unlocked Nexus One or Droid/Milestone worked on Rogers’ wireless band, I’d grab one of those when it was a possibility.

Nonetheless, I was pleasantly surprised recently to find that Rogers was offering all HTC Dream owners a free HTC Magic for $0, with the caveat that your term length pushes out. Given that Dream owners can only possibly be 6 or 7 months into their term, that isn’t that tough of a demand. I am on a very reasonable family plan that allows me 5GB / month (which I seldom use more than 1% of), so I feel fairly future-proofed with that foundation and for me it was all win.

So the next day a Magic arrived in the mail and moments later I was up and running with it. With the SIM card removed my existing Dream still works on wifi, where it can browse the web and play media and respond to emails and take pictures, and I can of course put another card in it and continue using it online. I’ll likely install Cyanogen on it now.

Quite pleased about that.

The most shocking thing, though, is that this Magic is much more responsive. It has the same processor as the Dream, so that doesn’t explain the difference. If I had to guess, I’d point to RAM, which on this device comes in at 288MB, compared to the 192MB in the Dream. For comparison both the Droid and the iPhone 3GS feature 256MB of RAM.

The extra headroom over the base OS seems to make all the difference in the world. On the Magic I can see that the free memory is usually less than 90MB, even on a fresh start-up, which notably would put it over the limits of the Dream.

HTC and Rogers claim that they’ll release Android 2.1 for this device in the near future, which makes me especially pleased.

Great move, Rogers. The new HTC Sense update and free month of data is icing on the cupcake.

Firefox 3.6 Released – Web Worker Performance Remains the Same

Back in June I wrote about Web Workers, a fantastic new method to move processing out of the UI thread. To support the entry I posted a variation of the SunSpider benchmark I named Moonbat.

Safari kicked Firefox around in this benchmark. I just tried it with the just released 3.6, and it doesn’t look like much has changed: FF 3.6 does 10 iterations with 4 threads in ~11 seconds, Chrome does it in 2.6 seconds, while Safari leads the pack at 2.3 seconds.

Alas, web worker performance isn’t a critical factor in choosing a browser (my favourite browser remains Firefox), but it would be nice to see it moving in the right direction.

Celebrating My First Home High Speed Overage

Got the cable bill — a bill that pushes into the $250 range per month these days — to find a surprising $11.25 "internet overage fee". Apparently I used 67.5GB last month, while my limit is 60GB. The Steam sales, several purchased HD movies and a couple of on-demand games for the kids on the 360, added to the normal internet usage apparently really added up to a very atypically throughput-intensive month.

I'm not going to cry many tears about it, even though I do think $1.50 a GB is a bit absurd (in an average month I doubt I use 10GB, so now I almost feel obligated to max it out), given that I think by usage pricing would lead to a far better, more open, more honest system for everyone.

Friday, June 26 2009

Web Worker Benchmark - Moonbat

If you're running Firefox 3.5 or Safari 4 [EDIT: Or Chrome 3.0], take a look at the "benchmark"/technology demo I just put up. [Safari 4 compatibility added based upon the great comment submitted by Oliver]

It's a modified variant of the SunSpider benchmark that I've written about before (in less than flattering terms), which I heavily altered to utilize the remarkable new Web Worker functionality you can now explore in Firefox 3.5. If you're really analyzing performance, be sure to disable Firebug as it significantly impacts the results.

Google GearsWeb Workers, a standardization of a feature of Google Gears, are a remarkably simple method of multi-threading JavaScript, not just to get it out of the UI thread — where it can be very detrimental to the user experience as the interface freezes while a script runs — but also to scale across multiple CPUs and cores on modern PCs, which while seemingly a ridiculous notion ("but it's just JavaScript! Multithreading?") is becoming a real concern as the JavaScript engines continue to advance and the usage and scope of the language and related technologies continue to expand.

Through a simple, synchronized message passing system and a minimalist API, the Web Workers model lends itself to robust, elegant code that isn't as prone to classic multi-threading pitfalls. While not a part of the current instantiations, in a theoretical implementation there is no reason why web workers couldn't be located on entirely different machines, given that each worker is essentially an isolated runtime, sharing very little (the navigator properties and some basic security info for things like enforcing XmlHttp restrictions), communicating via serialized messages.

Understanding the Benchmark

The benchmark/technology demo is operational in Chrome, Opera, and Internet Explorer, but only if you change Web Workers to 0. In that case it is sequentially running the set of tests in the main thread, as JavaScript has traditionally been run. I didn't intend for this to be used for cross-browser comparisons, even if I resort to presenting just such a comparison at the end of this entry, and instead the focus is really on the technology, so the real "power" is seen once you start to turn up the web worker dial, all the way to 11.

SafariWeb worker multithreading isn't limited to Firefox 3.5. Oliver left a comment pointing to a Safari-ready variant he threw up, so I modified the test accordingly (the difference being that when Safari implemented it, it didn't intrinsically include JSON encoding, so your caller and receiver had to do that themselves). I didn't realize that Safari had covered this ground, though it isn't shocking given how rapidly that browser has been advancing.

With one web worker, the UI remains fully responsive to user interaction, which is an experience quite unlike what was seen at 0 (where the browser essentially locks up during the run), and the actual run itself suffers little for the isolation. On a quad-core CPU, the CPU usage during the duration of the test cycle fluctuates around approximately 25%.

At two web workers, the individual tests take slightly longer to run, however the actual completion and pace of the tests in the whole is greatly improved. Not quite a halving of the runtime, but not too far off. Two cores are saturated during the duration of the test.

At three web workers, three of the cores are filled with work, and the total elapsed time improves somewhat, albeit not by the ratio that correlates with the 50% increase in computation power.

At four web workers, we've tapped out the parallelism and despite all four cores being saturated for most of the duration, the total runtime actually suffers slightly. Going above four doesn't cost much, but it also brings no real gain (beyond possible algorithm gain isolated various parts of the application).

You can also run a mode where instead of running a modified js directly in the worker thread, the code is passed as a string parameter, eval'd into a function reference, and the function is run. There are some interesting observations to be observed by this test, such as the lack of tracemonkey loop optimizations on eval'd code (see bitwise-and in particular. It suffers dramatically when run as an eval'd function relative to running as literal JavaScript). This surprised me as the eval merely instantiates a function in the current context, but doesn't run it, yet the performance penalty remains because it was sourced from an eval.

Here are some results for 1-8 threads, running 10 cycles of each test, gathering the total elapsed time in Safari 4 and Firefox 3.5 RC2. This was run on a quad-core Q9400 machine, and of course your mileage will vary. While it is evident that Firefox 3.5 is using more of the available processing power as you move past 1 thread, with it increasing from 25%, 50%, 75%, to 100% at 1, 2, 3, and 4 threads respectively, it doesn't fully benefit from the additional resources, yielding a greatly diminished rate of return. Safari, on the other hand, already started with a considerable lead, and it pulled away with each thread up to the optimal 4, really hitting its stride.

Multiple threads in Safari and Firefox 3.5

I'll add some charts and the like to this entry later, but just thought I'd drop a line on that demo of a very promising technology that will soon see fairly robust deploymet (one huge benefit of Firefox -- shared by Chrome and Opera -- is that the uptake rate for new versions is extremely high).

  Firefox 
Thursday, June 25 2009

This entry is just a lead-in to the next entry that'll be about an exciting technology in Firefox 3.5. I didn't want to bloat up that entry with my parentheticals and rants, so just wanted to get that out of the way here.

Firefox 3.5 – You Should be Trying It

Have you tried out Firefox 3.5 yet? It’ll happily install side-by-side, so there’s very little risk giving it a spin.

While currently a Release Candidate, it is already supported by most popular add-ins, such as Firebug and Adblock Plus, and brings a bounty of new functionality, more comprehensive emerging standards support, all while improving performance.

Performance has never been Firefox’s strong suit. While some incorrectly believe that Firefox has just recently been overtaken by upstarts like Webkit and its bastard child Chrome – the lore being that Firefox’s creaky “old” legacy code is not as nimble as the newer projects – the truth is that Firefox has always been a performance laggard compared to all but Internet Explorer.

It has always used more memory, done things more slowly, with benchmarking and resource consumption metrics that seldom earned it praise. The history of Firefox (aka Mozilla Suite, Phoenix and Firebird) is a tortured legacy littered with complaints about slow start-up times, a slow page layout engine, massive memory consumption, and middling JavaScript performance.

These are the costs of building on the XUL abstraction, along with some expensive add-on scaffolding. The ability for an add-on to dramatically change the behaviour of the browser (all from within a world of JavaScript and chrome) isn’t just an accidental happenchance, but instead is the result of considered, pervasive design choices.

The EU Fines Opera for Their Monopolistic Browser Stranglehold

If a small footprint and snappy response were the keys to success, Opera would have taken the market by storm given that it’s been evangelizing and focusing on that pursuit, to a great degree of technical success and leadership, for well over a decade now. Yet most users care more about a slightly better bookmark manager than they do about even magnitude differences in JavaScript performance.

But performance does matter. As web applications grow richer and more elaborate, the weakest of the contenders will get pushed out of the race. Already web applications like Slashdot and Facebook are getting unpleasant with a few of the current contenders, yet some of the new features of standards like HTML 5 promise dramatic new functionality that will completely blow the top off of the domain restrictions of the browser world.

So with recent releases the Firefox crew has reduced the toll you have to pay for these architectural choices, and through a lot of hard work it’s getting to be a memory lightweight, as far as web browsers go, and performance has improved across the board, sometimes dramatically.

Your Browser Is a Remarkably Complex Software Product

And to sidetrack for a moment about a personal peeve, let me kick down the frequent whiners’ complaint that it’s “just a web browser”. Every time someone make such an ignorant, misinformed statement -- usually during some entitled complaint about resource consumption on their obsolete PC -- I think a universe blinks out of existence in some alternate reality.

There is very likely nothing that you do on your PC that is as rich and complex as the things that you’re doing right now just browsing the web. It’s isn’t “just a web browser”, it should be “I can’t believe how much is happening for me to loll around on the web for a bit!”.

  Firefox 
Saturday, January 10 2009

Saw the news today that the Russian version of Firefox was dumping Google, switching to a Russian search engine called Yandex. This caught my eye as recently I've been contemplating how the industry would react to Microsoft taking over, effectively, the sponsorship of the Firefox project.

For those unaware, the Mozilla foundation gets almost 90% of its income — used to pay developers, run servers, do marketing, and so on — from Google: $75 million dollars in 2007 (along with some chump change from Yahoo and Amazon). This isn't an act of charity, though, and for its payment Google gets default start page space, is the default search provider, and of course gets attributed with a lot of goodwill throughout the industry for helping to keep the project alive and robust.

Now that Google is strongly pushing their own browser, however, the relationship isn't quite as solid. Shortly before Chrome's release the contract was extended through to 2011 — probably by some concerned players that wanted to stop any NIHism from undoing what they had achieved — but that's just two measly years and will pass before most people realize.

The Russian deal seems to be one sign that the Mozilla foundation is soberly planning ahead.

And while they're considering who might step in if Google decides to bow out, they might look towards the most unlikely partner of all: Microsoft.

Increasingly Microsoft has been embracing Firefox as a platform, with various divisions working towards more than just locking you into Windows (which has perverted the cause of many Microsoft products for years, destroying potential greatness). Given the relatively pathetic progress of Internet Explorer, I'd go so far as to say that they've put more work into pulling Firefox into the fold than they have improving their own browser.

It's chump change for Microsoft (despite all of the doom and gloom stories about Microsoft, the reality is that they are still disgustingly profitable), it would buy them a tremendous amount of goodwill, it would give their ignored Live Search (haven't they abandoned the whole Live thing yet? I'm waiting for the next wave of inane branding synergies from that marketing midget) some attention, and it would give them a voice on the project that is most likely to continue to enrich and improve the web. Yet it wouldn't give then undue influence or control on this project, which we know because even Google was held away from the reigns of power (which presumably is why they wanted to let Mozilla use their ball while they went and bought another ball and built their own court.)

  IT   Firefox   Microsoft 
Wednesday, December 31 2008

The Good of 2008

Financial Opportunities for Independent Application and Game Makers

While so-called “ISVs” (small software shops, often staffed by just the founding programmer) have largely disappeared from the Windows platform, pushed out by Microsoft’s total dominance of most IT spend alongside a widespread consumer mentality that software should always be free — whether in the libre sense ala open source, or the more prevalent gratis sense of free in the form of piracy (often justified with bizarre logic that goes something like “I paid $499 for this PC! I’m not paying more for software!”) — other lucrative opportunities have opened up for entrepreneurial developers.

Alternative platforms like cell phones (the iPhone, Google’s Android, or the more scattered but numerous Java ME targets) and game machines (such as the Xbox 360) have provided tremendous new opportunities with limited barriers to entry. Vendor online stores and fair revenue sharing splits have made selling your product easier and more rewarding than ever before.

On the Mac the independent software market remains very robust, with a consumer base that is willing to spend for software that enhances their quality of life in some way.

Display Technology

They’ve gotten larger (but lighter and more energy efficient), have faster response rates and better quality, with color range and contrast ratios seeing great improvements, all while remarkably coming down in price. Large-screen displays with 1920x1080 pixels are becoming commonplace in media rooms, even during the downturn.

Day Trip To The City The displays in our living rooms are capable of displaying the best of converging digital media. The division between the “home computer” and the home entertainment systems (a split that began when computers started demanding better displays, a need which saw the Commodore 64 and later generations leave the family room to take up accommodations in the home office) has dissolved.

JavaScript

Over a short span JavaScript has gone from being unloved and despised, begrudgingly used only out of necessity, to being widely exploited as a language that, while deceptively simple on the surface, is incredibly rich and succulent when you look just a little deeper.

Even long time practitioners of JavaScript regularly discover new functionality they never realized was there.

The increased focus on JavaScript, and the growing richness of the web, kicked off a skirmish between a variety of projects and vendors, with a horse race between the Mozilla project, Webkit (primarily in its Safari instantiation), Opera, and the upstart Google Chrome browser. JavaScript performance in some of these latest generation offerings can even rival native code in isolated scenarios, which is extraordinary for such a high-level, dynamic language long identified as a performance pig.

It’s now worthy of serious consideration whether to use one of the JavaScript runtimes (such as V8, Tamarin, or Tracemonkey) as an engine for projects having nothing to do with the client-side web.

coffees Not all is roses with JavaScript, though. The drive towards ECMAScript 4.0 AKA JavaScript 2.0; representing a pretty dramatic shift in the language; hit some serious road blocks this year, eventually smashing off the road and exploding into mangled bits.

It’s a little fuzzy where JavaScript is heading in the coming years, but at least it’ll do it in an impressive number of iterations per second.

The Microsoft Xbox 360

Microsoft reduced the price and improved the interface and functionality. They diversified the marketing and game catalog to cater to more than just teenaged first-person shooter fanatics. For a unit that is now over 3 years old (with hardware that was probably spec’d out even a year earlier) it shows few age wrinkles, with very decent graphics at ultra-high resolutions, only occasional suffering frame rate slowdowns.

While it’s worth the price for gaming-fu alone, the 360 also doubles as a viable media extender (especially when coupled with a UPnP host like TVersity running on a PC somewhere else on the network). After bouts using full PC media boxes in the home theater setup, with the many time-thieving downsides they bring, I’m very happy to replace all of that with a simple Xbox 360 (playing streamed internet radio, Divx/Xvid, home movies on the networked NAS, YouTube clips, and so on.) With the 1080p connection and the horsepower to decode most anything without glitches, it’s a strong link in the media chain.

The marketplace functionality offers up easy access to a wide range of gaming and entertainment options, including the ability to queue up movies, shows and games on the unit or even on their online site from other devices, making them available on your 360 surprisingly quickly (I’ve queued up movies for the kids on my PC to find them available on the unit mere minutes later, seemingly exceeding the capacity of my cable connection.)

US owners with a Netflix subscription also get instant streaming of a wide range of movies.

With a decent motion sensing controller — which apparently is coming soon via a new controller codenamed “Newton”, though that could simply be more internet lies gaining truth through repeated assertion — the 360 would be uncontested.

Complaints are few, but the unit isn’t perfect.

It has a taste for polycarbonate, for instance, viciously destroying discs if you happen to move the unit at all while it’s on and endlessly spinning the disc.

[SUPER PRO TIP: After my GTA IV got eaten during a foolhardy move of a powered-on unit, the game would no longer launch but instead would freeze up the device. I never got around to replacing it, though I did discover that Rockstar Games does offer replacement media if you ship your old media to them along with $7.50. After the new NXE interface was released a few months back, with its newly offered install-to-disc functionality, out of curiosity I rented GTA IV from a local video and game store, installed it to the hard drive, and then returned it. From then on the game plays perfectly with my now defective disc in the drive. Presumably the sectors it checks to validate ownership are all still fine, and as another benefit I no longer have to listen to the optical disc noise whenever the unit is on, which is a huge improvement regardless.]

The “HD” movies available for rent online are decidedly not HD, at least not comparable to blu-ray or the defunct HD-DVD format. This isn’t surprising given that they clock in at about 4 to 6GB, versus the 30GB or so for many really high definition movies, both options using the latest codecs. They also offer a mediocre 24 hour view window from first play for rented/downloaded videos, and prices that seem a bit excessive (HD rentals come in at around $8 here in Canada, versus the $5.49 to rent from a video store, and the latter option gives me much more liberal usage times). Media embargos mean that a lot of movies simply aren’t available to Canadian users.

Computing Power

Computing power has gotten incredible. Quad-core CPUs, giant caches, ultra fast memory, arrays of massive storage devices. The storage front in particular holds incredible promise now that we’re adding SSDs to the mix. Here’s a pretty neat little product for a DIY SSD, in this case multiplexing 6 SDHC cards for much faster access. Get 6 of those (each with 6 SDHC cards), put them in a RAID10 array…you’d have absurd speed levels for about $800 for an array with 288GB of usable space. Sure that isn’t a lot of space, but it’s enough space for most reporting or OLTP databases, and you’d be enjoying 360MB/second or so read speeds and 60MB/second write speeds or better, coupled with almost instant access times.

Some inefficient-for-processing-but-good-for-development practices and technologies are becoming more tenable with the surfeit of computing power we have available to us.

The Bad of 2008

Computing Power

While it also made a showing in the Best of 2008, available computing power is still underpowered for video tasks. Once you start editing and rendering 1080p videos from the growingly common HD video cameras, and the speed of storage, the speed of memory, the speed of processors (even though video processing is one of the most capable and willing of using quad-core CPUs…it still isn’t enough)…all of it leaves a lot to be desired and makes it a less than pleasant, time consuming experience. An add-in MPEG4 compression coprocessor might be a good choice (my HD video camera has it, this tiny device doing real-time AVCHD compression, AVCHD being a variant of MPEG4, squashing to 17Mbps of video and audio info).

Video Codecs

The video codec world is a mess. If I want to convert from AVCHD to a Divx AVI, why is any transcoding necessary at all (which always reduces quality)? Both are MPEG4 codecs. In fact, virtually every top-tier codec now is just a pretty face and quasi-unique wrapper around MPEG4, albeit usually with just enough secret sauce to screw it all up. So why not just standardize on one wrapper? It seems to be incompatibility for the sake of incompatibility. [EDIT: Ben noted in the comments that I was quite wrong here. Turns out that MPEG4 is a bit of a hodge podge of codecs, and Divx shares little in common with AVC. From now on I’ll be encoding home video clips to x.264]

Blu-ray

The movies are too expensive. The benefits are too few. While the under-featured players (which seldom offer now common DVD functionality like Divx/MP4 playback, USB media playback, etc) are finally dropping in price, it’s still only a good option if you have a reliable source of rentable blu-ray discs (services like Netflix or Zip.ca, for instance, or a well-stocked local video store.)  If you buy discs you have the irritant of likely not being able to play them in the family minivan, the kids’ computer, your laptop, and so on, which is one of the major downsides of blu-ray.

The opportunity window for a new optical disc format is closing quickly given the growing interest and utilization in internet and proprietary cable system delivery (VOD from your cable company, watching downloaded or streamed movies on your Xbox 360, iTunes movie downloads, etc).

Locally, this year’s boxing day consumptionfest featured a bevy of blu-ray player sales, and it is a sign of the times that many of them still have large numbers of units left. Strangely the lack of competition with HD-DVD has left a lot of people uninterested in the genre as a whole, which is quite contrary to many predictions that predicted a blu-ray euphoria once the competition was settled.

It’s a bit surprising that blu-ray discs carry a price premium: They’re harder to rip (though the idea that they are uncrackable has proven untrue), and the outcome is a massive file that is difficult to duplicate on media — unless you want to put it on a burnable blu-ray disc that costs more than buying the movie new, or seriously degrade the quality which would sort of miss the point of ripping from a high definition source (no codec Divx magic here. The codecs used on most blu-ray discs are the cutting edge) — or online. I would expect the media groups to heavily push blu-ray, at no price penalty, purely to try to head off piracy with a more unwieldy format.

Google’s Chrome Browser

Chrome could be the world’s greatest browser and I still wouldn’t like it. Thankfully it isn’t the best browser by a long shot, so I don’t have to rationalize that conflict too far. Aside from a mostly theoretical process isolation model (which seems to have little real-world benefit, as many users find Chrome to be one of the most catastrophically crashy browsers of the bunch), Chrome offers little to justify choosing it. The V8 JavaScript engine would have been a winner if it came out 6 months earlier, but it turns out that Google was far from alone in working to speed up JavaScript.

The reason I grief about Chrome is because it has no reason to exist. The only viable reasons why Google felt the need to make their own browser are decidedly not good for the internet at large. Google owning and controlling a browser brings the same worries and concerns that Microsoft controlling a browser does.

Google makes their money selling ads. It concerns me having an advertising company running a browser project, even if they do provide a related-but-not-quite-the-same source tree as if that makes everything okay.

It bothers me even more that Google’s advertising initiatives have completely focused on subverting the Firefox userbase, cannibalizing a credible alternative to Internet Explorer that was finally becoming mainstream. I’m not entirely sure what Google’s motives are with this plan, but there is no way they can color this as Google the Good And Benevolent. It’s either an insidious end game playing out, or it’s some insular, egotistical developers at Google who just had to control things themselves, not content to work with the existing browser projects when they can stand tall and scream “We’re Google damnit! We’re super smart!”

Macromedia cum Adobe Flash

Many of the problems people encounter with “Firefox “(purported memory bloat and CPU saturation) are Flash related.

On my three-year-old son’s low-end PC — a Pentium IV 1.7Ghz with 1GB (anemic but not that bad) — many of the great online children games sites (such as CBC, NickJr, PBS, TVOntario), which are largely built around Flash, slog to an unusable crawl in Firefox, yet they run with gusto in IE on the same PC. This is odd given that the overwhelming bulk of computation in both cases occur entirely within the Flash environment (the browser essentially acting as a thin wrapper, and I can't imagine the basic communication between environments is so onerous that it could account for the difference), so hypothetically there should be complete equivalency between the browsers.

The #1 problem many users have using Linux-based boxes to browse the tubes are Flash related. This is becoming more critical as more and more Linux-based NetBooks hit the market.

Memory leaks. Sluggishness. Crashes. Flash is quite often the source.

Commerce Court - Toronto Flash brings a tremendous amount of richness to the web. Without it those game sites really couldn’t exist (I exclude Java and ActiveX given their serious problems, not to mention that Flash is purpose suited for exactly these sorts of projects), and of course it is now the foundation for most every video site. Adobe even donated the Tamarin project to the Mozilla project, though it didn’t turn out being the win it should have been given that Tamarin is largely focused on the DoA JavaScript 2.

Adobe really needs to fix this player. It has become foundational to the web.

Internet Explorer 8

This browser is so incredibly terrible that I have think that all of the MS developers that launched IE to greatness between versions 4 to 6 must have gone on twenty-year sabbaticals with their then-lucrative stock options. This browser is terrible in every way, and unless there is some tremendous forward momentum in the final sprint, it is completely unjustifiable as a browser choice, not even ranking among the top tier browsers (which include Firefox, Safari, Opera, and to a lesser extent Chrome). Using IE 8 would be like using Netware to run your network today, simply because it once was a good choice.

Nintendo Wii

The Wii has a lot going for it.

It has a great range of family friendly games, built in wireless connectivity, and unarguably innovative controls. It has a large catalog of games, and is easy to use with a low complexity barrier to entry.

It has been the definite winner of the next generation console wars, even though Nintendo brought the last generation to the fight.

I want to love the Wii.

But I don’t.

Many Wii games seem to utilize the motion sensing controls in the most gimmicky way possible, featuring shallow gameplay that seems more like a quickly hacked together technology demo than a serious offering.

Even where you aren’t forced to flail around with the control to do rudimentary actions, you quickly find that philosophically many Wii games insist upon “balance”, kicking you in the nads when you’re ahead, giving you a firm push when you’re behind.

Maybe there’s something cultural about that. But when I’m trying to crush my children’s contest hopes with my Mario Kart awesomeness, teaching them a life lesson about competitiveness, it’s a bit flummoxing to continually get knocked down while they get an endless series of speedups.

My five year daughter easily dominates my long-time-bowler father-in-law in Wii bowling, with seemingly random movements yielding amazingly strings of strikes.

Then there are the often unavoidable text bubbles that assault the player in the hundreds, making an unwanted appearance in many Wii games (particularly those sourced from Japan. This seems to be something that Japanese games have relied upon heavily going back to the Phantasy Star / Zelda days). Going past these asinine play obstacles is incredibly irritating, at least for me. Half the game play, it seems, is the challenge of maintaining sanity and an interest in the game after clicking through a hundred sparse text bubbles full of unnecessary and uninteresting filler text.

While the motion sensing element of the controllers are arguably best of this generation (using standard Bluetooth making them theoretically usable on other devices like the PC), the other hardware of the Wii is seriously outdated: Basically last generation’s Gamecube with a paintjob. The SDTV output is underwhelming, offering so little definition that it’s painful to play split-screen multiplayer, which is a waste given that many of these units are hooked up to sets capable of at least 1280x720, often even 1920x1080.

As one of the early buyers of the Wii, and the target demographic given that my family features three young children, I can’t help but express some disappointment in the unit. I really don’t understand how it still manages to get the attention it does, still existing in a honeymoon while people stock up on hardware and games they’ll never actually play.

[Sidenote: Got the kids Wii Music for Christmas to discover it’s more of the same formula. It’s a mile wide and one inch deep. Yet again it seems like a technology demo dressed up as a pretend game]

Online Comments

While it’s expected that the sophistication of comments on a site like YouTube will lie somewhere around the intellectual level of head-injured drunk, there remained the hope that other sites might feature a more intelligent contributor. When some major Canadian newspapers added comments, I looked forward to a presumed onslaught of interesting and thought provoking contributions. Instead I was disheartened by the complete lack of political sophistication, the partisan political team cheerleading, the sophistry, the endless logical fallacies, the idiocy…all of it has reduced my opinion of mankind. I can only hope that it is a grossly unrepresentative demographic that feels the need to post their thoughts on newspaper sites.

The Decline of Honesty

When did lying become so acceptable and commonplace? When did people feel so justified in descending to lies so long as it gets hits?

The Internet has always been home to a large number of hoaxes and exaggerations, but this year saw truth and reality suffering a serious beat down, and it only looks to be getting worse.

Some lies made their presence known via the blogger’s tale of extraordinary interaction with some larger than life caricature (which a gullible readership ate up because it confirmed their own simplified worldview, biases or bigotry.) Honestly, goatse with a chaser of tubgirl was less offensive than some of the obviously manufactured fiction being paraded as truth nowadays.

Lies also appeared with frequency on “citizen journalism” sites, where there’s a strong incentive to egregiously misrepresent or misreport, zooming to top the social sites with the most extravagant and inflammatory story possible. A recent example — only one of an endless stream of alike cases — would be the FDA’s decision that the many benefits of eating fish are so compelling that they outweighed the small potential risks of mercury, so they considered revising their existing recommendations that encouraged avoidance, switching to one that was more moderate, in the same way that exercise is generally recommended even though you might get hit by a car or a stray asteroid. Along came the “citizen journalism” sites simply discarding the kernel of truth, instead declaring that the FDA decided that mercury is “safe” (presumably at the behest of their Mega Mercury Corporation masters).

No nuances or fuzzy grays that require a moment of thought are desired when there’s a crowd to enrage into voting you up and forwarding the story on to others. For all of Fox News’ many, many, many faults, they have a brother in citizen journalism on the net.

Lies also grew via the viral videos that have been saturating the net, with that seemingly no-cost amateur video more likely being an expensive production of a Lying for a Living viral video manufacturer. Lie it up, and afterwards everyone can have a big laugh about it and cheer on your product.

So much content is undeclared fiction now that it’s a bit of a cry wolf story playing out. Many readers have become so jaded they simply believe nothing that they can’t witness directly themselves. You don’t even need to “look at the pixels” anymore: If it’s getting a lot of attention, it’s probably made up from a blogger’s imagination, a gross misrepresentation that has little correlation with reality, or a viral video that somehow is going to get some company attention.

Yeah, there’s a sex toy on the side table of your real estate picture — ha ha ha. Enjoy the PageRank your little hoax earned as every social media site plays right into your devious plans with links, a gullible public all thinking they caught you in a hilarious blunder instead of the planned out web strategy you’re pursuing. Another variation is the "super duper terrible site...let’s all point and laugh", when the only ones that should be laughing are the people fooling you.

True stories have little impact in an environment of gross exaggerations or manufactured tales and caricatures.

The Economy

It didn’t take a psychic to see the dangers of the bubble economy (though many who pronounced some caution now hilarious see themselves as economic seers). Madoff is getting a lot of press for his apparent ponzi scheme, yet in many ways the whole market is one giant ponzi scheme. While people often like to talk about the “true value” of things (homes, oil, resources, etc), the true value is often whatever the market is willing to bear at the moment — whatever the prevailing mindset is — which is a situation naturally prone to booms and busts. Hopefully the downside of the bust is flushed out quickly and we can begin the next round of financial chicken.

Hopes for 2009

I hope the public at large becomes a lot less gullible. Extraordinary claims demand extraordinary proof.

I hope Google abandons the Chrome project, as they have abandoned many other misadventures before. Already the adoption has been mediocre, despite widespread launch press and a strong push by Google.

I hope upstream bandwidth starts opening up. It’s great that I have 10Mbps downstream virtually around the clock, but when I want to send a 10GB home video to a relative (yup, people actually do make their own content sometimes. It isn’t all about P2P sharing of pirated material), suddenly that 0.5Mbps upstream looks rather anemic. A lot of potential uses for the internet are being choked off by the widespread limiting of upstream bandwidth.

I hope SSDs continue to increase in speed and drop in price, and the operating system makers such as Microsoft properly adapt to this storage mechanism (for instance a paging file is not a good idea on flash devices. Personally I think they aren’t a good idea at all on any modern PC). Unlike a hard drive that generally has but one head mechanism, the potential multiplexing within SSDs is virtually unlimited, so the speed potential is virtually boundless.

I hope social link sites move towards more enlightened, individually focused algorithms, moving away from groupthink and herd behavior.

I hope disparate devices and appliances continue to gain capabilities and marketshare, and a robust third-party development community is encouraged and supported for each (and not just in the "create free stuff for our product so we can sell more and make more money, suckers" way, but in a mature model that allows for monetization by partners — even the tiny uISV — bringing value to the product and rewards to the creators).

Friday, December 21 2007

“What gets measured gets done.”

I decided to take the new SunSpider benchmarks for a spin, generating the pretty graphs found down below. Benchmarks are always entertaining, and it was enjoyable comparing the numbers yielded under various conditions (turning SpeedStep on and off [none of the benchmarks loaded the CPU long enough for it to bother raising up from its lowered power, 66% performance relaxation state], setting CPU affinity, running it on different PCs, trying different build options on my Firefox build, etc.)

"Why benchmark at all?" one might ask. Simple: If you find the right measures, the common wisdom goes, the inputs to the measure will improve as the various players work to improve the metrics.

Whether you’re measuring bugs per developer, lines-of-code, widgets per hour…whatever: Start measuring it and invariably it’ll start moving in the desired direction, whether this actually serves your end goal or not. Often such initiatives come at the cost of the unmeasured, but over time it adapts and starts serving as a beneficial feedback.

The Assembly Line Benchmark - Widgets per Hour

The WidgetDuring the summer in my late teens I worked on an assembly line building car parts (pieces that played some sort of role in the air conditioning system – basically widgets): Put a little bracket in a metal cylinder, add a circle of fiberglass, inject some desiccant beads using a machine, add another fiberglass circle and another metal bracket to hold it all in place and then put it in another machine that squashed another cylinder onto the top. Then I sent it down the line to the welder.

Atop my machine sat a little counter that monitored my progress, carefully recording every piece assembled. While this was a less advanced era — being the prehistoric early 90s and all — and I had to manually transfer the final count to my timecard for submission, every worker was kept somewhat honest by the metrics submitted by the other workers on the line.

Clearly I couldn’t have done 2000 parts in a day if the people before me and behind me in line only reported 1000, for instance, and vice versa.

Coupled with continuous, careful QA tests and random inspections (performed by people who had their own metrics to work towards), this struck me as an excellent system because it was difficult or impossible to game, and the onerous checks ensured that it didn’t come at the expense of quality.

It certainly worked wonders on me, as I wiled away the endless summer days performing the most awesomely brainlessness of tasks by competing with my own personal productivity “records”, trying to push out more quality parts per hour day after day.

I was there and had nothing better to do, and that little counter sat looking down on me, mocking me. It dared me to do just a couple more pieces per hour, and I willingly complied.

Somewhere a paper pusher and cackling middle manager would sum up the part counts and rub their hands together in giddy glee, eager for my zombie-state quest for worth to pad their bonus cheques.

It’s good I was a summer employee, because my pace didn’t make me friends on the line.

Test Driven Development tries to create a similar spirit of metrics, giving you a goal to strive for as you build out your product. It’s a comforting bit of feedback when all of the TDD tests come back with green checkmarks. The more tests you create, the higher the absolute count of passes you can brag about when the product sails through with flying colors, easily passing 497 of the 497 tests.

Performance benchmarks serve the same purpose for the performance and efficiency domain.

Consider the initial hardware-accelerating video cards for Windows. Early on they seemed to have little or no purpose, and were almost abstract to users. Then benchmarks started appearing, giving the manufacturers something to strive towards while also providing end users with an easy way to compare and choose amongst the options. “Card {A} can only do 10,000,000 accelerated rectangles per second, while card {B} can do 12,000,000. Clearly we need to get card {B} for our rectangle displaying needs.”

Gaming the MetricsDiamond Speedstar 24x

Of course some vendors started gaming the metrics in various creative ways (see Joel's excellent essay on poorly thought out metrics). Several created products that actually recognized running benchmarks in hardware, “optimizing” (by any means possible, including simply discarding many of the benchmark commands, knowing the end user will never notice if every second rectangle or rendered text of the millions per second isn’t being rendered). Worse, the benchmarks were so atrociously artificial, bearing little similarity to actual everyday use that the direction of progress was to optimize the performance of benchmarks, often to the detriment of everyday use.

Eventually the benchmarks matured, getting better and more realistic, and the gaming was prevented or embarrassingly exposed, and it became a hugely beneficial tool in the march forward in the field. Various games have served the benchmarking role, the Doom and then Quake series being the most influential.

In the browser market, the growing interactivity of the web and the renewed competition amongst the big competitors has seen a flurry of benchmarks being widely discussed and debated, stereotyping each of the browsers into performance ghettoes. “Firefox is sooooo slow….” “IE is garbage. Opera is super speedy!”

Having some real tests is of obvious benefit to “set the record straight”, not to mention that it provides a carrot for the competitors to chase. Exactly that happened with me a while back when I came across a string concatenation benchmark, so I went in and streamlined the piece of Firefox code specifically impacted by that benchmark. My change in place, Firefox indeed did much better on that specific benchmark, though the real-world benefit was negligible.

In many ways the various web benchmarks available reminds me of the early accelerated video card benchmarks: Crude, having little or no correlation with the pain points of real-world use, and opportune for gaming and false evangelism.

WebKit's SunSpider

Which brings me to the recently released SunSpider benchmark (which is a credible contender for the widely coveted “most poorly chosen project name” award: It’s bad enough that an Apple project uses “Sun” in their product name, but it's thrice as bad when it’s a project related to JavaScript – JavaScript being another nominee).

SunSpider is very easy to run and gives quick feedback, so quite a few charts and graphs have been sprouting on blogs across the land.

JavaScript/DOM performance is a huge concern right now, as web applications are growing in richness by leaps and bounds, so there is definitely a need to be filled.

Will SunSpider be what we've all been looking for?

Here’s just such a graph, charting the stacked benchmark runtime for the current tier-1 browsers for Windows.

SunSpider Benchmark Results

Benchmarks were performed on a 4GB, Q6600 quad-core Core 2 processor machine running Vista x64. Firefox 3 was built from the current CVS (as of this morning). The Y-axis represents milliseconds.

Such a benchmark provides immediate feedback regarding the biggest bang for the buck optimization, at least in regards to improving the runtime of this particular benchmark. For IE 7 it is pretty clear that the benchmark killer is the bizarre and repeated use of string concatenation throughout the benchmark tests, particularly evident in the string-base64 and string-validate benchmark.

Naive String Concatenations

After approximately 20 seconds (okay, maybe 22 seconds) "optimizing" the base64 and validate tests to use the extremely common Array push/toString idiom that is used on pretty much any page that does more than the most trivial of string operations (my changes were rash and very simplistic, though if I were motivated — if this were production code — I could do a much better job with it), the performance had changed rather dramatically, as seen in the following graph (scroll up and down for dramatic flair).

SunSpider Benchmark Results

It's late and I'm tired, but I'd guarantee that I could dramatically decrease the remaining largest test -- string tagcloud -- but I think the point is proven.

Some will naturally draw from this the presumption that I'm just an Internet Explorer 7 fan, desperately manipulating the benchmark to best fit the strengths and avoid the weaknesses of my favourite browser.

They'd be wrong.

My browser of choice is Firefox. Not only do I not find the featureset of Internet Explorer 7 uncompelling and anemic compared to a naked copy of Firefox (not evening considering the enormous functionality offered by add-ins, such as the extraordinary Firebug), I find the performance of Microsoft's offering to be atrocious on real-world websites.

I don't like Internet Explorer on technical grounds, and I like it even less given the concerning conflict of interest it represents.

Perhaps I'm just bearing a grudge.

We're currently implementing a very rich, advanced web application, and one thing that we've found, in case after case, is that in real-world situations with extensive DOM manipulation and production JavaScript, Internet Explorer stumbles and groans under the load, while competing browsers complete the task with gusto (just rendering a dynamically loaded complex table takes 20x or more on IE than in Firefox 2. The disparity grows greater with Firefox 3). It's to the point that I can't help but wonder if Microsoft is trying to undermine the whole web thing intentionally, hoping to encourage the middle-grounders to hoard to the boards proclaiming the deficiencies of web apps, manipulated into begging for some XAML goodness.

So if I wasn't looking to defend IE7, what was my point?

Lies, Damned Lies, and Benchmarks

Maybe the motivations of the team behind this benchmark were noble, and they weren't blinded into naturally biasing the benchmark towards their own project, but I can't help but see this benchmark as an entirely artificial, naive, unrealistic benchmark that adds little to the benchmarking landscape. A cursory glance through the benchmark sees bizarre oddities that would never appear in real-world code, and a variety of implementation choices that are questionable for a benchmark (for instance test/sample data is often constructed within the timed scope of the benchmark in the SunSpider tests, as if a production website needs to create 4000 random email addresses and ZIP codes, for instance. Normally such data is constructed outside of the timed loop, for obvious reasons).

The lack of weighting, the lack of realistic test scenarios... I'm just not convinced that it holds much utility (though I do like the way they have the "driver", and the elegant and clean client-side way they aggregate the test values, and do the same for comparison. The framework is a great foundation) for cross-browser comparison. I can see use in analyzing performance differences for a single browser (the results turning Firebug on and off, for instance, were very surprizing), just not as a valid comparison between different browsers.

Just as I dramatically changed the IE results in less than a minute of code changing, I'd guarantee that I could do the same with the other outliers (in particular the longer Firefox tests).

I'm still waiting for a good, real-world benchmark. Something that simulates sites like Digg, Slashdot, Facebook, interacting with them in a way that a real world user really would.

Earlier EntriesLater Entries

Dennis Forbes