Tags related to tag macaccessibility alpha api apple ars birthday blog browser cachegrind chrome client css debug developer emulator extension firefox google history javascript jit kde linux metadata microsoft mozilla open-source opera operating system optimization osx performance perl php profiling python rdf rss safari search security software sqlite standards svg unix user-agent v8
Sunday, November 9, 2008
Valgrind is a entire suite of open-source tools, including basic debugging, profiling, and more advanced techniques such as threading, memory management, and leak detection. For the purposes of this article, I will focus on Cachegrind, and in particular within the domain of Web applications. Although there are a number of developers contributing to Valgrind, Julian Seward is the original designer and author.
Out of the three server-side languages I am most familiar with, PHP seems to be the one that is best represented, with some Python—but I found very little if any information on Perl.
What is Cachegrind?
Cachegrind is an Intel CPU emulator and cache profiler that performs detailed simulations of the onboard I1, D1 and L2 caches and can accurately pinpoint the sources of cache misses in your code. It identifies the number of cache misses, memory references, and instructions executed for each line of source code. (paraphrased)
Xdebug
Xdebug is the tool of
choice for PHP developers when it comes to standard debugging, and the built-in profiler with Cachegrind output is also maturing. Typically the output is in a file named cachegrind.out.pid, which is plain text, but be careful with large, complex applications as it can grow to on the order of 500MB. The raw data is almost useless, to really analyze and visualize the results you need a parsing/graphing tool. There are several available depending on your platform and needs.
Viewers
Once you have your output you need an application to make sense of it. Listed below are solutions for Linux (or any Unix-like OS running KDE), Mac OS X, Windows, and even a browser-based solution from Google Code.
Related Reading
Wednesday, November 5, 2008
There used to be a lot of talk about browser wars (both old ones and new), but now days it seems the race is on to see who can develop the fastest JavaScript engine. Not surprising given the explosive growth in front-end development, and JavaScript frameworks and effects libraries. Oh, and a little thing called Ajax. So I spent some time researching and evaluating the current, and future, state of JavaScript implementations and these are my findings.
Evaluation Parameters
Before I get into what's on the horizon, I took the time to evaluate the relative performance of JavaScript in four current browsers. I'll be using the WebKit SunSpider JavaScript benchmarking tool on my Dell XP Pro laptop with the latest Service Packs installed. Internet Explorer is not in the mix because, first of all I can't stand the browser, but mostly because it would likely be crushed by the other competitors—listed below by product, version, vendor, and JavaScript engine:
To level the playing field, each test was performed after a fresh restart with no other foreground applications running. Of the four, Firefox was the most heavily loaded, at least in terms of the number of extensions/plugins installed. I'm not sure if that would have an impact on the results or not. In all cases there were no other tabs open to skew the results (Google mail leaps to mind).
Firefox
RESULTS (means and 95% confidence intervals)
-------------------------------------------------
Total: 6506.0ms +/- 1.1%
-------------------------------------------------
3d: 693.6ms +/- 2.0%
cube: 264.2ms +/- 3.6%
morph: 200.0ms +/- 2.6%
raytrace: 229.4ms +/- 1.6%
access: 997.4ms +/- 1.2%
binary-trees: 152.2ms +/- 3.0%
fannkuch: 473.4ms +/- 0.6%
nbody: 236.8ms +/- 3.3%
nsieve: 135.0ms +/- 4.5%
bitops: 789.8ms +/- 3.2%
3bit-bits-in-byte: 186.4ms +/- 4.5%
bits-in-byte: 212.0ms +/- 0.6%
bitwise-and: 151.0ms +/- 0.8%
nsieve-bits: 240.4ms +/- 7.6%
controlflow: 166.6ms +/- 6.5%
recursive: 166.6ms +/- 6.5%
crypto: 494.8ms +/- 1.7%
aes: 174.2ms +/- 1.3%
md5: 160.2ms +/- 2.1%
sha1: 160.4ms +/- 3.1%
date: 571.4ms +/- 4.5%
format-tofte: 357.4ms +/- 6.6%
format-xparb: 214.0ms +/- 7.8%
math: 742.0ms +/- 1.9%
cordic: 351.2ms +/- 1.8%
partial-sums: 218.4ms +/- 5.5%
spectral-norm: 172.4ms +/- 1.1%
regexp: 508.6ms +/- 7.1%
dna: 508.6ms +/- 7.1%
string: 1541.8ms +/- 0.4%
base64: 176.4ms +/- 3.5%
fasta: 381.6ms +/- 1.6%
tagcloud: 296.0ms +/- 3.4%
unpack-code: 476.0ms +/- 1.3%
validate-input: 211.8ms +/- 4.8%
Safari
RESULTS (means and 95% confidence intervals)
-------------------------------------------------
Total: 6428.2ms +/- 1.1%
-------------------------------------------------
3d: 745.0ms +/- 1.9%
cube: 240.2ms +/- 3.7%
morph: 258.4ms +/- 3.9%
raytrace: 246.4ms +/- 2.7%
access: 977.0ms +/- 2.1%
binary-trees: 132.0ms +/- 4.2%
fannkuch: 474.8ms +/- 2.4%
nbody: 242.2ms +/- 5.6%
nsieve: 128.0ms +/- 8.1%
bitops: 782.8ms +/- 2.1%
3bit-bits-in-byte: 120.0ms +/- 0.0%
bits-in-byte: 176.0ms +/- 3.9%
bitwise-and: 292.4ms +/- 3.6%
nsieve-bits: 194.4ms +/- 3.6%
controlflow: 154.2ms +/- 4.3%
recursive: 154.2ms +/- 4.3%
crypto: 442.8ms +/- 3.0%
aes: 164.2ms +/- 6.7%
md5: 136.2ms +/- 5.2%
sha1: 142.4ms +/- 4.2%
date: 624.8ms +/- 1.1%
format-tofte: 262.0ms +/- 2.1%
format-xparb: 362.8ms +/- 1.6%
math: 811.4ms +/- 2.9%
cordic: 322.6ms +/- 3.3%
partial-sums: 330.2ms +/- 4.5%
spectral-norm: 158.6ms +/- 3.8%
regexp: 520.8ms +/- 0.1%
dna: 520.8ms +/- 0.1%
string: 1369.4ms +/- 6.9%
base64: 184.0ms +/- 3.7%
fasta: 328.2ms +/- 3.1%
tagcloud: 314.4ms +/- 30.2%
unpack-code: 268.6ms +/- 4.0%
validate-input: 274.2ms +/- 2.4%
Chrome
RESULTS (means and 95% confidence intervals)
-------------------------------------------------
Total: 2697.4ms +/- 2.6%
-------------------------------------------------
3d: 237.8ms +/- 12.9%
cube: 53.8ms +/- 9.3%
morph: 120.6ms +/- 24.5%
raytrace: 63.4ms +/- 3.0%
access: 154.6ms +/- 6.0%
binary-trees: 10.8ms +/- 18.9%
fannkuch: 54.4ms +/- 3.5%
nbody: 54.0ms +/- 9.4%
nsieve: 35.4ms +/- 7.7%
bitops: 119.8ms +/- 5.6%
3bit-bits-in-byte: 9.8ms +/- 5.7%
bits-in-byte: 18.8ms +/- 7.2%
bitwise-and: 37.4ms +/- 3.8%
nsieve-bits: 53.8ms +/- 11.1%
controlflow: 6.8ms +/- 8.2%
recursive: 6.8ms +/- 8.2%
crypto: 96.8ms +/- 4.4%
aes: 33.8ms +/- 9.9%
md5: 32.4ms +/- 3.4%
sha1: 30.6ms +/- 2.2%
date: 621.6ms +/- 2.7%
format-tofte: 264.8ms +/- 6.5%
format-xparb: 356.8ms +/- 1.8%
math: 198.4ms +/- 5.3%
cordic: 105.2ms +/- 10.6%
partial-sums: 67.2ms +/- 5.1%
spectral-norm: 26.0ms +/- 3.4%
regexp: 547.4ms +/- 1.7%
dna: 547.4ms +/- 1.7%
string: 714.2ms +/- 2.2%
base64: 73.0ms +/- 13.6%
fasta: 99.8ms +/- 2.8%
tagcloud: 188.0ms +/- 3.7%
unpack-code: 246.0ms +/- 1.2%
validate-input: 107.4ms +/- 3.0%
Opera
RESULTS (means and 95% confidence intervals)
-------------------------------------------------
Total: 7536.2ms +/- 1.2%
-------------------------------------------------
3d: 815.6ms +/- 2.7%
cube: 254.4ms +/- 2.5%
morph: 302.6ms +/- 5.5%
raytrace: 258.6ms +/- 2.3%
access: 1160.4ms +/- 0.8%
binary-trees: 82.4ms +/- 7.3%
fannkuch: 568.8ms +/- 1.0%
nbody: 314.6ms +/- 1.9%
nsieve: 194.6ms +/- 3.5%
bitops: 987.2ms +/- 10.8%
3bit-bits-in-byte: 116.2ms +/- 5.6%
bits-in-byte: 238.2ms +/- 44.3%
bitwise-and: 378.6ms +/- 1.4%
nsieve-bits: 254.2ms +/- 2.6%
controlflow: 98.2ms +/- 10.3%
recursive: 98.2ms +/- 10.3%
crypto: 454.6ms +/- 2.8%
aes: 214.2ms +/- 5.5%
md5: 120.2ms +/- 0.5%
sha1: 120.2ms +/- 0.5%
date: 551.0ms +/- 2.9%
format-tofte: 290.6ms +/- 5.3%
format-xparb: 260.4ms +/- 0.3%
math: 638.6ms +/- 3.1%
cordic: 278.2ms +/- 5.8%
partial-sums: 206.2ms +/- 3.4%
spectral-norm: 154.2ms +/- 4.3%
regexp: 871.6ms +/- 2.5%
dna: 871.6ms +/- 2.5%
string: 1959.0ms +/- 1.0%
base64: 200.4ms +/- 0.3%
fasta: 392.6ms +/- 1.3%
tagcloud: 390.6ms +/- 2.4%
unpack-code: 765.0ms +/- 0.9%
validate-input: 210.4ms +/- 4.2%
Findings
Ranked from fastest to slowest overall:
- Chrome — 2697.4ms
- Safari — 6428.2ms
- Firefox — 6506.0ms
- Opera — 7536.2ms
Now I'm not a statistician, but Safari and Firefox yielded very similar results in the middle ground, while Chrome was the clear winner with Opera at the bottom (surprising, given the browser's reputation for performance). SunSpider has a nice feature that allows you to compare two result sets. The difference from fastest to slowest was a staggering 279% speed increase in Chrome over Opera. Of course a lot depends on what you're using JavaScript for, hence the breakdown into categories and different operations within those categories. If you enjoy pouring over raw data, by all means have at it.
On the Horizon
Over the past several months we've seen all manner of announcements and articles about JavaScript performance improvements and what to expect when this research and development makes its way into the mainstream. We've learned about trace trees, JIT compilers, direct-threaded, bytecode optimizers, and so on. Mozilla, for example, plans to roll out it's TraceMonkey engine with the release of Firefox 3.1. For the impatient, you can grab a copy of the 3.1 nightly builds and enable TraceMonkey now if you want to play with it or do your own testing. One can only speculate on how Google and Opera will respond to these latest developments.
Related Reading
Saturday, April 1, 2006
Apple Turns 30 today. It's no Mac joke! Here's a nice timeline of the company. Engadget has an interesting retrospective and Wired has a brief offbeat one too.
Asa Dotzler announced that as of yesterday, Mozilla is 8 years old. Wow.
Happy birthday and thanks for all the innovations!
Saturday, March 25, 2006
Mac OS X is five years old. John Siracusa takes a look at the road behind as he ponders the critical role the OS has played in Apple’s revitalization.
From closing the book on the original Mac to practically inventing a new platform overnight, OS X changed Apple and its users in ways that worthy of a birthday reflection. Mac OS X 10.0 was the end of many things. First and foremost, it was the end of one of the most drawn-out, heart-wrenching death spirals in the history of the technology sector. Historians (and Wall Street) may say that it was the iMac, with its fresh, daring industrial design, that marked the turning point for Apple. But that iMac was merely a stay of execution at best, and a last, desperate gasp at worst. By the turn of the century, Apple needed a new OS, and it needed one badly. Happy fifth birthday, Mac OS X, and many happy returns!
About the Author
John is a prolific writer and an authority on Apple, Macs and OS X. More than just a computer industry journalist, he also enjoys programming in Perl and is a U2 fan. I have to respect those choices. If you're interested, you can check out more of his Ars Technica articles.
Via the dnews Ars Technica News Desk RSS Feed.
Thursday, March 23, 2006
The first developer preview release of Firefox 2.0, codenamed Bon Echo, is now available for testing purposes only. You should probably avoid installing it on a production desktop client if you intend to continue using version 1.5.0.1 (or earlier) and want to save your existing environment.
Bon Echo Alpha 1, the first development milestone of Mozilla Firefox 2 aimed at developers and testers, is now available for download from ftp.mozilla.org. Bon Echo Alpha 1 is the first of many developer milestones on the path to Firefox 2. This milestone is focused on testing the backend infrastructure supporting the new Places functionality.
Source: mozillaZine.
New Features
- Changes to tabbed browsing behavior
- New data storage layer for bookmarks and history using SQLite
- Extended search plugin format
- Updates to the extension system to provide enhanced security and localization
- Support for SVG text using svg:textPath
Supported Platforms
A list of notable bug fixes is forthcoming.
If you feel like living on the bleeding edge, or want to help out by evaluating one of the first builds, jump in there and give it a try.
Thursday, February 9, 2006
When I posted earlier about the Firefox 1.5.0.1 update I complained about wanting to wait for a SpellBound update before installing the upgrade. For various reasons I decided to go ahead and upgrade my browser.
But I quickly found I was missing spell checking too much so I started to investigate a solution. Like all extensions, there are two values in the RDF install resource script that tells Firefox which browser version(s) the extension is designed for. This RDF is basically a list of application metadata and is known as the Install Manifest. Under the <em:targetApplication> element the extension author will set the min and max versions supported. Sometimes all that is necessary to get a disabled extension to work is to modify the max value to match your browser and reinstall the extension. This especially true for minor version updates like 1.5 to 1.5.0.1.
However, it can be a real headache to track down the install.rdf manifest in your Firefox extensions directory, edit the file, and reinstall. So here's one solution that not only worked for SpellBound (the current version available on SourceForge and the Extensions Mirror is 0.7.3), it also worked for the (English) dictionary I had installed, and a few other extensions that were disabled. Start by installing the Nightly Tester Tools extension (make sure you grab the latest version, as of this writing it was 0.7.9.11). Afterwards you will find that your Tools->Extensions dialog has a new button "Make all compatible" next to the "Find Updates" button. Now click on the Make all compatible button and restart Firefox. Like magic, SpellBound is working again.
Now these instructions come with a caveat. Many of the features in Nightly Tester Tools are experimental and there is no guarantee that your extensions will actually function with the newer version of Firefox once you upgrade. Always search for and install upgrades from the author first if they are available. And here's another tip for you, if you find all this removing, installing and upgrading of extensions is a pain, then I recommend trying Restart Firefox—I have been using it for awhile and it is one handy little shortcut.
And now the plot thickens. That's right folks, I am no longer running the old version of SpellBound at all. This morning I began evaluating the Performancing blog editing extension (an outstanding tool, more on that later) and discovered a sweet replacement, namely the SpellBound Development version. Along with everything you're already used to (plus it fixes a few bugs that I noticed with the older version), you now have spell check as you type (misspelled words are underlined in red), context menu replacements (Ctrl+click on the misspelled word) and a full API so that other extensions (such as the rich text editor provided with Performancing) can take advantage of spell checking. Nice.
You may have noticed of late that blogZero has had something of a browser thread going. Opera 9 is cool, all the new browsers for OS X are great too, but from my point of view nothing beats Firefox for shear power in the form of all these excellent extensions.
Wednesday, February 8, 2006
Is your sweetheart also a Mac lover? If so, Camino 1.0 is scheduled for release on Valentine's Day. That would be February 14th. I think I've gone completely browser happy (which is way out of touch if you ask me). Or perhaps it's only temporary madness.
Via Forever Geek.
Thursday, January 5, 2006
Rumor has it that (along with that video thing), Google will be announcing tomorrow at the CES show in Las Vegas, a new software bundle dubbed "Google Pack." Along with Google Earth, Google Desktop, Google Talk, Google Toolbar and Picasa, the bundle will include:
And some other stuff that may or may not be worth mentioning (depending on who you ask). If you run a Linux or Mac OS X desktop, you could probably care less since many of these apps target Windows. Personally, I'm glad to see Google with all of its power continue their support and advocacy of Firefox.
Tuesday, December 20, 2005
Google Zeitgeist — From the top dog of search engines, the top searches for 2005: Overall, World Affairs, Nature, Movies and Celebrities.
digg spy — Watch real-time any or all of new submissions, "dugg" stories, buried (declined) stories and new comments.
Mac IE 5 — Microsoft will no longer support Internet Explorer for Mac, and after January, 2006 you will no longer be able to download it.
Wednesday, November 30, 2005
Today, Mozilla announces the official release of Firefox version 1.5, and along with it a brand new Web site with a .com domain. Among the many new improvements are:
- An improved software update system which runs unobtrusively in the background.
- A redesigned and easier to use Preferences/Options system.
- Faster forward and backward page navigation.
- Reordering of browser tabs via drag-and-drop.
- Improved pop-up blocking.
- Accessibility improvements for users with physical impairments.
- Even better security features.
- Privacy features that allow you to clear sensitive data (cookies, form data, passwords).
- Support for new standards and technologies including SVG, CSS, and Javascript 1.6.
- Better support for the Mac OS X platform.
You can learn more, download, and install it from http://www.mozilla.com/firefox/.
What are you waiting for? The best open-source, open-standards, cross-platform Web browser just got a whole lot better!

|