write(msg)

write(msg)

A Linux blog to share any hints, tips, ebuilds, and insight I have picked up along the way. My interests mainly lie in security, photography, the web, and multimedia.

Sunday, August 31, 2008

Web 2.0 Browser shootout

When I hear "Web 2.0" I think about the next generation of interactive, networked interfaces. Some of these new interfaces will not be attached to a browser at all but many will remain browser-centric, or will at least will be rendered using W3C standards. There are a lot of technologies like Flash and Silverlight that are helping to drive Web 2.0 forward but ultimately the oldest form of client side automation, javascript, is and will continue to be the preferred solution because of its entrenched usage and frameworks like AJAX and JSON. Adding to this is the recent javascript improvements from the Webkit team and the Gecko team. Soon we will be processing javascript at near native code speed.

As you can see from my previous javascript benchmarks the current leader is Gecko when it comes to performance of a stable release rendering engine. Webkit does very well in the SVN version and will be an excellent javascript performer when the current Squirrelfish implementation is stabilized. From the benchmarks released for tracemonkey we will see even greater improvement in javascript when xulrunner 1.9.1 is released. That is estimated to be about 3 months out at this point. Currently 64 bit is not supported as I figured out in an attempt to test tracemonkey performance. Opera seems a long way from Gecko and Webkit when it comes to javascript performance but the browser itself is featureful and Opera produces an excellent mobile browser which will only become increasingly important in years to come.

The next important piece to the Web 2.0 puzzle is standards compliance. This has become increasinly important as more browsers have shown up on the average users' radar. Mac users have Safari (Webkit), Opera and Firefox (Gecko), Linux users have Gecko browsers, KHTML from which Webkit is derived, and Opera, Windows users have Opera, Safari, IE, and Firefox. As you can see only IE is not cross-platfrom. The Unix version of IE died a long time ago and the Mac version more recently but there is no recent version of IE that is supported on another OS other than a Microsoft one. On mobile devices a variety a browsers are offered. Opera is offered on many different platforms. Gecko and Webkit, being open source can be ported to many different platforms and have already been ported to some. IE stands alone again as a MS only product. For this reason I think that IE has a limited future in Web 2.0. Not everything runs a MS OS and this isn't going to change in the future in fact I think this fact is only going to become more pronounced as mobile devices become more popular.

The infamous Acid tests test W3C CSS compliance. The current test is Acid3. It tests CSS3 compliance. Browsers are on their way to achieving Acid3 conformance and in fact a previous SVN build of Webkit passed the Acid3 test but current versions do not. Here is how the current Webkit scores:



Unfortunately at this point Midori (using Webkit) crashes in addition to failing Acid3. The current unstable Xulrunner (Gecko) doesn't crash and make it farther in the test but the visual results aren't quite as good:



The unstable version of Xulrunner produces better results while still not passing:



Opera does okay but still isn't there yet either:



Testing IE with Acid3 shows similary half baked solutions but I don't have the results to show because I don't have Windows on this computer. It makes it to 71 with all gray boxes before it quits, much like the current Gecko engine. Regardless I think IE is going to have very little to do with the Web 2.0 revolution compared to other browsers simply because it is not cross platform.

Taking into consideration both javascript performance and acid3 compliance only Webkit and Gecko seems ready to take on Web 2.0 full force. They both have excellent javascript speed and are getting to acid3 compliance quicker than other browsers. Opera is a good browser but I think they might be better served working on Webkit and integrating it with their web browser than continuing their own engine. This would save resources to work on other aspects of the browser while retaining an excellent browsing experience. Gecko has made huge strides and continues to do so. In the future I think we will be talking about Webkit vs Gecko as opposed to IE vs Netscape like we did over ten years ago. Ultimately both engines are going to drive Web 2.0 development much more so than the alternatives.

Labels: , , , , , , , , , ,

Saturday, August 30, 2008

Opera Javascript Comparison

Since I've been posting about javascript performance lately I thougt I would compare Opera v.9.52 JS performance to the current release of Xulrunner running under Epiphany 2.22. The results are mixed. Celtic Kane's javascript speed test shows results that best Gecko but not Webkit.



In comparison I was only able to achieve a score of 255 (lower is better) for the current Xulrunner. This looks good for Opera. Let's take a look at the sunspider benchmark now. Xulrunner is show in the FROM column while Opera is shown in the TO column.



As you can see Opera's javascript perfomance is significantly slower than Xulrunner's performance. I am a bit confused by the results considering Opera did pretty well in Celtic Kane's test and I have heard that Opera's JS performance is very good. My sunspider results were so out of whack from what I was expecting that I ran them again but the results were the same. I wonder if anyone else can confirm my findings.

Labels: , , , ,

Wednesday, August 27, 2008

Tracemonkey javascript performance

I thought that my comparison of the latest Webkit vs stable Gecko wasn't fair so I decided today to create an ebuild to fetch the latest xulrunner so I could test Tracemonkey. I had to tweak the ebuild a little (other than fetching with mercurial) because xulrunner would not compile with lcms enabled. I created another USE flag that toggles lcms. With this and some modification to the patch tarball I was able to build the latest xulrunner.

Here is my ebuild:

/usr/local/portage/net-libs/xulrunner/xulrunner-9999.ebuild

This ebuild requires the xulrunner.conf from the original ebuild files.

Next I launched Epiphany and typed "about:config". I searched for "jit" and then toggled "javascript.options.jit.content" to true and restarted my browser. Then I proceeded to run Celtic Kane's javascript speed test and the Sunspider Benchmark. Celtic Kane's test didn't show much of an improvement over the old javascript engine and didn't come close to Squirrelfish's performance. The result was a paltry 23ms decrease in time.



Maybe the Sunspider Benchmark would be different. Here is the comparison of the old Gecko JS engine and Tracemonkey. The old engine is under the FROM title and Tracemonkey is under TO.



We see some significant improvements over the old engine but we see some regression too. The overall picture shows us a slight improvement. Next let's compare Webkit's results to Tracemonkey. Here we have Webkit in the TO column and Tracemonky in the FROM column. Get ready for an all out browser war!



Yikes! That's disappointing. For all the noise we've heard about Tracemonkey these were not the results I was expecting. Squirrelfish is still eating it for lunch. I guess it's a good sign that Mozilla's numbers are improving but I have yet to see the performance they claim. There could be many reasons for this and I'm sure things will only improve but as it stands now I cannot achieve the kind of numbers I've seen put up on the web about Tracemonkey.

UPDATE: Apparently JIT cannot yet be enabled in 64-bit browsers so that is why perfromance is so close between the new Tracemonkey JS engine and the old one. When that changes I'll post a real performance comparison.

Labels: , , , , , , ,

Tuesday, August 26, 2008

Webkit vs Gecko Javascript performance

If you haven't noticed I have a fascination with bleeding edge software. One of the pieces of software I have been following since its inception is the GTK port of Webkit. It is an excellent browser engine that is just as capable if not more so than other major competing engines. One of Webkit's strong points is javascript performance. The Squirrelfish javascript engine that was introduced a few months ago offers incredible performance.

To prove my point I tested the latest Webkit from subversion againt Xulrunner-1.9 using two different javascript tests. The first test is I used was Celtic Kane's Javascript speed test. I ran the test a couple dozen times on each browser. The Webkit based Midori browser scored an 89ms (lower is better) for its best case while the best I was able to acheive with Epiphany on Xulrunner was 255ms which makes it over 2.5 times slower. In fact Midori's worst time wasn't even close to Epiphany's best time. I took screenshots of the two best times I achieved. On the left are the results for Webkit/Midori while on the right are results for Gecko/Epiphany.


The second test I ran was Webkit's own Sunspider Javascript test. It is a much more complete javascript test and takes several minutes to complete. Again Webkit outshines Gecko in the Sunspider tests but the results are much closer. Webkit's javascript engine, Squirrelfish averages about 1.5 times faster than Gecko's engine. Webkit results are shown in the FROM column while Gecko results are in the TO column.



It seems this is all about to change. Firefox 3.1 is supposed to include a new and improved javascript engine called Tracemonkey that outshines Squirrelfish. It is not yet complete so it is hard to tell how much better it is actually going to be but preliminary tests show some amazing results. When I get a chance to test it I'll post another comparison.

With all the improvements going into both the Gecko engine and the Webkit engine it should make web browsing on either platfrom a much better experience. I do have to give the Mozilla foundation credit for Gecko. I was starting to prefer a Webkit based GNOME environment over embedded Gecko but Xulrunner-1.9/Firefox-3 was a very good release and the next release is only going to be better. Things are really heating up now in the browser wars again.

Labels: , , , , , , , ,

Monday, August 25, 2008

Updated sK1 gnome patch

It seems that the latest revision of sK1 has a new configurator.py that breaks my old gnome patch. I've updated the patch to work with the latest revision. Hopefully this won't end up being an arms race type of affair where configurator.py is constantly changing. Just rename to gnome-sK1.patch and copy in place of the old patch and remember to edit the fonts and font sizes in the patch if you want to match your gnome theme better.

Labels: , , , ,

Updated Midori ebuild

Midori is now using a new build system so if you attempt to emerge it like before it will not work. There is an updated ebuild available on bugzilla. Unfortunately I have yet to get it to work. It builds fine with the new ebuild but the program will not start. I am using it in conjunction with my webkit-gtk svn ebuild. If I find the solution to the problem I will post an update.

UPDATE: It's working now. I built it with a vanilla compiler instead of my default hardened compiler and it is running now. I test Acid3 on Midori everytime I rebuild it. It gets to 77 before it crashes. This is better than the 69 I was getting before. At one time I was able to acheive 100 percent compliance but that hasn't happened in months. My biggest gripe/bug continues to be the font settings. It seems that Midori will not respect my font settings until I adjust them. I have to change the font size and then change it back again every time I start Midori.

Labels: , , , , ,

Journey to the 4th dimension

There is an incredible series of videos called Dimensions available online that explore the 4th dimension using mathematics. The first half of the series is extremely accessible and allows even a mathematically inept person to understand the shape of 4 dimensional space. The second half of the series delves into complex numbers and spheres where the material is a little more complex but overall the creators of this series have simplified the concepts using excellent visual tools. Personally I think learning complex mathematical concepts has been made infinitely easier by the Dimensions series and I cannot wait for the next series.

Labels: ,

Friday, August 22, 2008

CSS: transparency with opaque text

CSS opacity is a relatively new feature that has become a part of CSS3. Currently Webkit, Gecko, and Opera support standard CSS opacity while IE7 supports opacity with a nonstandard CSS filter. The opacity tag is used like this:

#transblock {
opacity: .5;
}

This will give the div with the ID of transblock a transparency of 50%. You can do the same thing in IE7 with a filter. It looks like this:

#transblock {
filter:alpha(opacity=50);
}

Ideally you should use both attributes to get the same opacity in Firefox, Safari, Opera, and IE7. This does not work in old browsers, including IE6. Older versions of Firefox (<0.9)
#transblock {
position: absolute;
top: 0px;
left: 0px;
height: 200px;
width: 200px;
z-index: 0;
opacity: .5;
filter:alpha(opacity=50);
}

#block {
position: absolute;
top: 0px;
left: 0px;
height: 200px;
width: 200px;
z-index: 1;
}

Obviously you can add any other attributes you wish to the div. This becomes more difficult when you have a div with variable height because you need to repeat the div contents within both the transparent div and the opaque div. I find it is easiest if you limit what attributes you assign to the ID of the div and instead create a class with the shared attributes. So if you want a div with a background of 50% white transparency and a foreground of black bold opaque text it will look like this:

#transblock {
z-index: 0;
opacity .5:
filter:alpha(opacity=50);
background-color: white;
}

#block {
z-index: 1;
}

.block {
position: absolute;
top: 0px;
left: 0px
color: black;
text-decoration: bold;
}

Then when you declare these in XHTML you can use:

<div id="transblock" class="block">

and

<div id="block" class="block">

This way you only have to edit the class to change your layout without having to edit two different IDs. You should notice two things. First that this requires absolute positioning and z-index values to place the opaque text over the tranparent background. Second, I am using the same name for an ID that I use for a class. Normally I would say that this can be confusing but in this situation I think it is actually easier to understand and manipulate the code.

The use of a sperate class is only really needed if you have variable height because otherwise you do not need to repeat the code. The separate class makes sure that the attributes between the transparent div and the opaque div are always the same which ensures the size of the div is maintained whenever attributes or contents are changed within the div. The only time you would actually have to edit the IDs is if you wanted to change the opacity level or the color of the background.

One other thing to note is that IE7's opacity filter only works on elements with a specified height and/or width.

Labels: , , ,

Rhinebeck bi-planes

I posted a picture of the Nieuport 24 that crashed at Rhinebeck a few days ago. Today I will post a few others that I took that day. I regret that my picture of the famous Fokker Dr I triplane, known for it's association with the "Red Baron", did not come out so well so I did not post it. To be honest the Nieuport 24 picture came out the best in my opinion. I was in a hurry with my point and shoot so the pictures aren't great but they are the best ones I took that day.

This first bi-plane is known as the Albatros. It was a very successful German fighter eary in the war and was the type flown by the "Red Baron" before he flew the Fokker Dr I.

Fokker DIII at Rhinebeck Aerodrome, Copyright 2008 Christopher Smith

The "Jenny" as it was known was used to train American pilots during the war and became popular with barnstormers when the war was over and they were sold as surplus.

Curtis JN-4 at Rhinebeck Aerodrome, Copyright 2008 Christopher Smith

The Fokker DVII was a superior aircraft at the time and led to the second "Fokker Scourge".

Fokker DVII at Rhinebeck Aerodrome, Copyright 2008 Christopher Smith

A popular hobbyist bi-plane from the 1930's called the Great Lakes T2-1R. In the distance you can see a New Standard D-25 (left) and a Piper Cub (right).

Great Lakes T2-1R at Rhinebeck Aerodrome, Copyright 2008 Christopher Smith

Labels: ,

Thursday, August 21, 2008

Flash 10 update

Four days ago I installed Flash 10 on my laptop. I was hoping it would solve some of the issues I was having with Flash. Unfortunately I haven't seen many differences at all. I'm not sure if my problems are related to Flash itself or nspluginwrapper but Flash still crashes or hangs my browser occasionally and some Flash videos still don't work, they just display a gray box where the video should be. The good news is that Flash hasn't crashed X yet which started happening on my laptop recently with Flash 9. Also I haven't had any regressions yet so that's good news. I would recommend checking it yourself. I would love to know how well it is working on 32-bit machines.

UPDATE: Shortly after posting this I visited some other flash sites that normally worked with Flash 9 and they were not working correctly. I reverted to Flash 9 for the time being and things are back to "normal".

Labels: ,

Wednesday, August 20, 2008

Linux powersaving tunables

Linux offers many powersaving features but you have to know where to look to enable these features. There is a wealth of information over at LessWatts.org. I have greatly reduced my power consumption by implementing many of their tips. The first place you should start is by enabling cpufreq. This is probably the number one powersaving feature. I would also enable dynticks in the kernel. To get a better idea of how much power you are using make sure to enable the powertop interface in the kernel. Then there are many tunable powersaving features that you can manipulate from userland. Here are examples that I have used.

hal-disable-polling --device /dev/hda

Disables polling of your cdrom drive but without it most drives will not automatically recognize when a CD/DVD is inserted.

echo 5 > /sys/bus/pci/drivers/iwl3945/0000\:03\:00.0/power_level

Turns on powersaving features of the intel 3945 wireless card. Some people have reported that it can cause problems with staying connected to access points. I haven't had much trouble with it.

hdparm -B 1 -S 12 /dev/sda

Enables aggressive powersaving on the hard drive.

echo 1 > /sys/devices/system/cpu/sched_mc_power_savings

Increases CPU idle time which allows you to acheive lower power states.

echo min_power > /sys/class/scsi_host/host0/link_power_management_policy

Enables power managment for SATA.

echo 1500 > /proc/sys/vm/dirty_writeback_centisecs

Increases dirty VM writeback time which allows your HDD to stay spun down for longer periods of time.

In addition to these features the cpufreqd, laptop-mode, and powersave daemons all can help lower your wattage.

Labels: , , ,

Tuesday, August 19, 2008

Bi-plane crash at Rhinebeck Aerodrome

This post is a little offtopic but a couple of weeks ago I went to the Rhinebeck Aerodrome to see a bi-plane airshow. Yesterday I learned that there was an accident on sunday that resulted in the death of one of the pilots. When I read the news and saw that it was the Nieuport 24 that crashed I immediately searched for it amongst the photos I took that day. This picture is forever going to remind me just how fragile life is.

Nieuport 24 at Rhinebeck Aerodrome, Copyright 2008 Christopher Smith

Labels: , ,

Monday, August 18, 2008

Updated sK1 ebuild with gnome USE flag

I've updated my sK1 svn ebuild to include a gnome USE flag. The normal build defaults to Crystal icons. The USE flag patches the configurator.py file to use Tango icons and also changes the fonts. You can edit the patch to use different fonts if you like.

/usr/local/portage/media-gfx/sK1-9999.ebuild

/usr/local/portage/media-gfx/files/gnome-sK1.patch

Labels: , , , ,

Webkit-GTK svn ebuild

I have been very interested in Webkit ever since the GTK port was announced. It seems like a good fit for integration with Gnome applications like Epiphany and Evolution. Right now I'm using it in Evolution-RSS and Midori, a Webkit-GTK browser. There are a couple of svn snapshot ebuilds in portage but I find myself constantly creating new snapshot ebuilds to test out the latest Webkit-GTK along with the svn ebuild of Midori. So in a similar fashion to my sK1 svn ebuild I decided to create a Webkit-GTK svn ebuild. Be forewarned that the checkout process takes a very long time. Based on my genlop output the checkout process alone took 40 minutes and compilation took another 20 minutes.

/usr/local/portage/net-libs/webkit-gtk-9999.ebuild

Labels: , , , , , , , , ,

Sunday, August 17, 2008

Extremely hacked Flash 10 on Gentoo

Flash has always been a problem for me on 64-bit linux. It works ok with Nspluginwrapper but is continually crashing or hanging the browser. It has even started to crash X lately which is just screwed up. So I decided to take Flash 10 beta for a test drive to see if anything is improved but I ran into some stumbling blocks along the way. Nspluginwrapper failed to install the latest flash because it was missing some necessary 32-bit libraries. Fortunately I found that the 32-bit binaries of OpenOffice and Adobe Reader provided the necessary libraries but they were not located in /usr/lib32. I didn't want to mess with the library path so I just symlinked the necessary libraries into /usr/lib32. I logged out and back in again and Flash 10 is working! I'll report back later so see how well this hack stands up and how well Flash 10 performs. If you want to try it out here are a couple of files you might want. Remember that this only works on 64 bit, you need nspluginwrapper, and you must have both the Adobe Reader binary and the OpenOffice binary installed.

This script will symlink the necessary libs into place. It needs to be given execute permission and run as root. Also the script is extremely dumb so check the output for failures:

symlink.sh

This ebuild is just a copy from portage but with a modified version number to get the latest beta released on August 11, 2008:

/usr/local/portage/net-www/netscape-flash/netscape-flash-10_beta20080811.ebuild

Labels: , , , , ,

Evolution-RSS

For years I have been using Liferea for RSS feeds and Evolution for email. After years of searching for information in mailing lists using Evolution then switching to Liferea for RSS I got tired of it and started looking for a RSS plugin for Evolution when I found Evolution-RSS. That was a few months ago when the stable version was 0.0.8. Since then a newer version has been released but not updated in the sunrise overlay. I took the 0.0.8 ebuild and Auke Booij's advice on Gentoo Bugzilla and created this ebuild:

/usr/local/portage/gnome-extra/evolution-rss/evolution-rss-0.1.0.ebuild

The newest Evolution-RSS has the ability to display feeds using either Gecko or Webkit (if installed). You can also use Evolution's excellent search function on your RSS feeds. It makes finding information so much easier. The downsides are that it is still incomplete and I have come across a few crasher bugs (adding a feed within evolution crashes evo for me). Also there is no dbus integration so downloading feeds directly through Epiphany is a no go. You need to manually add feeds using evolution-import-rss.

Labels: , , , , , ,

Weird icon bug

I have beeen using the now defunct gTangish icons for a couple of months now and found a weird problem where icons in 32-bit binaries (I am using 64-bit) like Acrobat Reader, Raw Therapee, and Realplayer displaying larger than life to say the least. No other icon set had this problem. After some investigating I found that it was most likely a index.theme issue. Not wanting to look for the fatal flaw all day I decided I would base a new theme.index off of the gTango icon set which has now taken the place of gTangish. (I don't really like the gTango set as much as gTangish that's why I am still using it). Anyway here is what the problem looked liked:



The modified theme makes everything look normal again:



Here is the modified gTangish theme.index

Labels: , , , ,

Saturday, August 16, 2008

Conky

Conky is a system monitor for Linux. It can be customized in pretty much any way imagineable. This is what my conky looks like:


Here is my .conkyrc

Labels: ,

Friday, August 15, 2008

sK1 svn ebuild

For ten years now UNIX has had a fantastic vector editor called Skencil (formerly Sketch). The bad news is that it hasn't been updated in over 2 years. That's where sK1 comes in. It has a new updated interface along with a cairo backend and CMYK support for use in pre-press. I've been checking out svn versions and the project looks very promising although quite incomplete at the moment. Anyway, I got tired of fetching things manually and adapted an sK1 ebuild I found on the net to fetch the latest svn version. Here it is:

/usr/local/portage/media-gfx/sK1/sK1-9999.ebuild

Labels: , , , , ,

Watch TV on the internet with Miro

If you haven't heard of it yet Miro is an opensource internet TV application available for Linux, Mac, and Windows. It uses RSS feeds to grab torrents and then downloads them for viewing. There are is also a guide to watch free television but what if you want to watch a show that isn't in the guide? There is an easy workaround that should be familiar to you if you use bittorrent already, it's called Mininova.

First you need to navigate to Mininova and search for the show you want to watch. I will use the Daily Show as an example. You will get a list like this:


Click on any actual Daily Show episode. Notice that some results that are displayed are for other shows. When you do click on a torrent it will load another page with links like this at the top of the page:



Click on the show title, in this case "The Daily Show". This will load another page that prominently displays an orange RSS feed link:



Now open Miro and and from the toolbar menu choose Channels->Add a new channel. Use the rss feed for the show you searched for as the URL. That's it. Now you have a channel in Miro that will automatically download the latest feeds.

There are a couple of things to note. While this works quite well for me it isn't without issues. You will tend to get multiple of the same episodes because of the nature of a bittorrent search site. Also Miro isn't exaclty light on resources and it is a bit buggy to boot. The good news, at least for linux users, is that Banshee is going to be incorpoarting the same technology into their 1.4 release due out in September. If you haven't used it Banshee is one of the best media players for Linux and after the aforementioned 1.4 release I believe it will be the best media player hands down on any platform.

For Gentoo users out there here is an ebuild for the latest version of Miro (1.2.6) that I adapted from an ebuild for version 1.2.4 found on the net:

/usr/local/portage/media-tv/miro/miro-1.2.6.ebuild

/usr/local/portage/media-tv/miro/files/setup.py.patch

/usr/local/portage/media-tv/miro/files/MozillaBrowser.sed

Labels: , , , , , , , ,

Fix frequency scaling on Gentoo >=2.6.25

I created this blog for a few reasons. One of those reasons is to document tips, tricks, and workarounds for computer related problems that I have come across. I have been creating notes on my computer to reference these problems but this blog will allow me to not only store my findings on the web but also allow other people to access them should they provide useful. So without futher ado here is my first fix.

First a little background, my OS of choice is Gentoo Linux. Currently I am running a 64-bit kernel with a hardened profile, and a hardened gcc 4.2 from Xake's toolchain overlay. I am using PaX/Grsec for hardening.

The Problem:

After upgrading to kernel with version 2.6.25 or higher frequency scaling stopped working with cpufreqd. After hours of investigating the problem, and a few Gentoo forum posts it was determined that the problem lay with cpufrequtils. In order to work properly cpufrequtils had to be upgraded. Unfotunately there is only one cpufrequtils package in portage and it is quite old.

The Solution:

A new ebuild had to be created for the latest cpufrequtils. I based the new ebuild on the current ebuild only modifying the "epatch" line. Here are the results for anyone who may be experiencing issues with cpu frequency scaling on Gentoo.
/usr/local/portage/sys-power/cpufrequtils/cpufrequtils-004.ebuild

/usr/local/portage/sys-power/cpufrequtils/files/cpufrequtils-conf.d

/usr/local/portage/sys-power/cpufrequtils/files/cpufrequtils-init.d

Labels: , , , ,

write(msg)

A Linux blog to share any hints, tips, ebuilds, and insight I have picked up along the way. My interests mainly lie in security, photography, the web, and multimedia.

Sunday, August 31, 2008

Web 2.0 Browser shootout

When I hear "Web 2.0" I think about the next generation of interactive, networked interfaces. Some of these new interfaces will not be attached to a browser at all but many will remain browser-centric, or will at least will be rendered using W3C standards. There are a lot of technologies like Flash and Silverlight that are helping to drive Web 2.0 forward but ultimately the oldest form of client side automation, javascript, is and will continue to be the preferred solution because of its entrenched usage and frameworks like AJAX and JSON. Adding to this is the recent javascript improvements from the Webkit team and the Gecko team. Soon we will be processing javascript at near native code speed.

As you can see from my previous javascript benchmarks the current leader is Gecko when it comes to performance of a stable release rendering engine. Webkit does very well in the SVN version and will be an excellent javascript performer when the current Squirrelfish implementation is stabilized. From the benchmarks released for tracemonkey we will see even greater improvement in javascript when xulrunner 1.9.1 is released. That is estimated to be about 3 months out at this point. Currently 64 bit is not supported as I figured out in an attempt to test tracemonkey performance. Opera seems a long way from Gecko and Webkit when it comes to javascript performance but the browser itself is featureful and Opera produces an excellent mobile browser which will only become increasingly important in years to come.

The next important piece to the Web 2.0 puzzle is standards compliance. This has become increasinly important as more browsers have shown up on the average users' radar. Mac users have Safari (Webkit), Opera and Firefox (Gecko), Linux users have Gecko browsers, KHTML from which Webkit is derived, and Opera, Windows users have Opera, Safari, IE, and Firefox. As you can see only IE is not cross-platfrom. The Unix version of IE died a long time ago and the Mac version more recently but there is no recent version of IE that is supported on another OS other than a Microsoft one. On mobile devices a variety a browsers are offered. Opera is offered on many different platforms. Gecko and Webkit, being open source can be ported to many different platforms and have already been ported to some. IE stands alone again as a MS only product. For this reason I think that IE has a limited future in Web 2.0. Not everything runs a MS OS and this isn't going to change in the future in fact I think this fact is only going to become more pronounced as mobile devices become more popular.

The infamous Acid tests test W3C CSS compliance. The current test is Acid3. It tests CSS3 compliance. Browsers are on their way to achieving Acid3 conformance and in fact a previous SVN build of Webkit passed the Acid3 test but current versions do not. Here is how the current Webkit scores:



Unfortunately at this point Midori (using Webkit) crashes in addition to failing Acid3. The current unstable Xulrunner (Gecko) doesn't crash and make it farther in the test but the visual results aren't quite as good:



The unstable version of Xulrunner produces better results while still not passing:



Opera does okay but still isn't there yet either:



Testing IE with Acid3 shows similary half baked solutions but I don't have the results to show because I don't have Windows on this computer. It makes it to 71 with all gray boxes before it quits, much like the current Gecko engine. Regardless I think IE is going to have very little to do with the Web 2.0 revolution compared to other browsers simply because it is not cross platform.

Taking into consideration both javascript performance and acid3 compliance only Webkit and Gecko seems ready to take on Web 2.0 full force. They both have excellent javascript speed and are getting to acid3 compliance quicker than other browsers. Opera is a good browser but I think they might be better served working on Webkit and integrating it with their web browser than continuing their own engine. This would save resources to work on other aspects of the browser while retaining an excellent browsing experience. Gecko has made huge strides and continues to do so. In the future I think we will be talking about Webkit vs Gecko as opposed to IE vs Netscape like we did over ten years ago. Ultimately both engines are going to drive Web 2.0 development much more so than the alternatives.

Labels: , , , , , , , , , ,

Saturday, August 30, 2008

Opera Javascript Comparison

Since I've been posting about javascript performance lately I thougt I would compare Opera v.9.52 JS performance to the current release of Xulrunner running under Epiphany 2.22. The results are mixed. Celtic Kane's javascript speed test shows results that best Gecko but not Webkit.



In comparison I was only able to achieve a score of 255 (lower is better) for the current Xulrunner. This looks good for Opera. Let's take a look at the sunspider benchmark now. Xulrunner is show in the FROM column while Opera is shown in the TO column.



As you can see Opera's javascript perfomance is significantly slower than Xulrunner's performance. I am a bit confused by the results considering Opera did pretty well in Celtic Kane's test and I have heard that Opera's JS performance is very good. My sunspider results were so out of whack from what I was expecting that I ran them again but the results were the same. I wonder if anyone else can confirm my findings.

Labels: , , , ,

Wednesday, August 27, 2008

Tracemonkey javascript performance

I thought that my comparison of the latest Webkit vs stable Gecko wasn't fair so I decided today to create an ebuild to fetch the latest xulrunner so I could test Tracemonkey. I had to tweak the ebuild a little (other than fetching with mercurial) because xulrunner would not compile with lcms enabled. I created another USE flag that toggles lcms. With this and some modification to the patch tarball I was able to build the latest xulrunner.

Here is my ebuild:

/usr/local/portage/net-libs/xulrunner/xulrunner-9999.ebuild

This ebuild requires the xulrunner.conf from the original ebuild files.

Next I launched Epiphany and typed "about:config". I searched for "jit" and then toggled "javascript.options.jit.content" to true and restarted my browser. Then I proceeded to run Celtic Kane's javascript speed test and the Sunspider Benchmark. Celtic Kane's test didn't show much of an improvement over the old javascript engine and didn't come close to Squirrelfish's performance. The result was a paltry 23ms decrease in time.



Maybe the Sunspider Benchmark would be different. Here is the comparison of the old Gecko JS engine and Tracemonkey. The old engine is under the FROM title and Tracemonkey is under TO.



We see some significant improvements over the old engine but we see some regression too. The overall picture shows us a slight improvement. Next let's compare Webkit's results to Tracemonkey. Here we have Webkit in the TO column and Tracemonky in the FROM column. Get ready for an all out browser war!



Yikes! That's disappointing. For all the noise we've heard about Tracemonkey these were not the results I was expecting. Squirrelfish is still eating it for lunch. I guess it's a good sign that Mozilla's numbers are improving but I have yet to see the performance they claim. There could be many reasons for this and I'm sure things will only improve but as it stands now I cannot achieve the kind of numbers I've seen put up on the web about Tracemonkey.

UPDATE: Apparently JIT cannot yet be enabled in 64-bit browsers so that is why perfromance is so close between the new Tracemonkey JS engine and the old one. When that changes I'll post a real performance comparison.

Labels: , , , , , , ,

Tuesday, August 26, 2008

Webkit vs Gecko Javascript performance

If you haven't noticed I have a fascination with bleeding edge software. One of the pieces of software I have been following since its inception is the GTK port of Webkit. It is an excellent browser engine that is just as capable if not more so than other major competing engines. One of Webkit's strong points is javascript performance. The Squirrelfish javascript engine that was introduced a few months ago offers incredible performance.

To prove my point I tested the latest Webkit from subversion againt Xulrunner-1.9 using two different javascript tests. The first test is I used was Celtic Kane's Javascript speed test. I ran the test a couple dozen times on each browser. The Webkit based Midori browser scored an 89ms (lower is better) for its best case while the best I was able to acheive with Epiphany on Xulrunner was 255ms which makes it over 2.5 times slower. In fact Midori's worst time wasn't even close to Epiphany's best time. I took screenshots of the two best times I achieved. On the left are the results for Webkit/Midori while on the right are results for Gecko/Epiphany.


The second test I ran was Webkit's own Sunspider Javascript test. It is a much more complete javascript test and takes several minutes to complete. Again Webkit outshines Gecko in the Sunspider tests but the results are much closer. Webkit's javascript engine, Squirrelfish averages about 1.5 times faster than Gecko's engine. Webkit results are shown in the FROM column while Gecko results are in the TO column.



It seems this is all about to change. Firefox 3.1 is supposed to include a new and improved javascript engine called Tracemonkey that outshines Squirrelfish. It is not yet complete so it is hard to tell how much better it is actually going to be but preliminary tests show some amazing results. When I get a chance to test it I'll post another comparison.

With all the improvements going into both the Gecko engine and the Webkit engine it should make web browsing on either platfrom a much better experience. I do have to give the Mozilla foundation credit for Gecko. I was starting to prefer a Webkit based GNOME environment over embedded Gecko but Xulrunner-1.9/Firefox-3 was a very good release and the next release is only going to be better. Things are really heating up now in the browser wars again.

Labels: , , , , , , , ,

Monday, August 25, 2008

Updated sK1 gnome patch

It seems that the latest revision of sK1 has a new configurator.py that breaks my old gnome patch. I've updated the patch to work with the latest revision. Hopefully this won't end up being an arms race type of affair where configurator.py is constantly changing. Just rename to gnome-sK1.patch and copy in place of the old patch and remember to edit the fonts and font sizes in the patch if you want to match your gnome theme better.

Labels: , , , ,

Updated Midori ebuild

Midori is now using a new build system so if you attempt to emerge it like before it will not work. There is an updated ebuild available on bugzilla. Unfortunately I have yet to get it to work. It builds fine with the new ebuild but the program will not start. I am using it in conjunction with my webkit-gtk svn ebuild. If I find the solution to the problem I will post an update.

UPDATE: It's working now. I built it with a vanilla compiler instead of my default hardened compiler and it is running now. I test Acid3 on Midori everytime I rebuild it. It gets to 77 before it crashes. This is better than the 69 I was getting before. At one time I was able to acheive 100 percent compliance but that hasn't happened in months. My biggest gripe/bug continues to be the font settings. It seems that Midori will not respect my font settings until I adjust them. I have to change the font size and then change it back again every time I start Midori.

Labels: , , , , ,

Journey to the 4th dimension

There is an incredible series of videos called Dimensions available online that explore the 4th dimension using mathematics. The first half of the series is extremely accessible and allows even a mathematically inept person to understand the shape of 4 dimensional space. The second half of the series delves into complex numbers and spheres where the material is a little more complex but overall the creators of this series have simplified the concepts using excellent visual tools. Personally I think learning complex mathematical concepts has been made infinitely easier by the Dimensions series and I cannot wait for the next series.

Labels: ,

Friday, August 22, 2008

CSS: transparency with opaque text

CSS opacity is a relatively new feature that has become a part of CSS3. Currently Webkit, Gecko, and Opera support standard CSS opacity while IE7 supports opacity with a nonstandard CSS filter. The opacity tag is used like this:

#transblock {
opacity: .5;
}

This will give the div with the ID of transblock a transparency of 50%. You can do the same thing in IE7 with a filter. It looks like this:

#transblock {
filter:alpha(opacity=50);
}

Ideally you should use both attributes to get the same opacity in Firefox, Safari, Opera, and IE7. This does not work in old browsers, including IE6. Older versions of Firefox (<0.9)
#transblock {
position: absolute;
top: 0px;
left: 0px;
height: 200px;
width: 200px;
z-index: 0;
opacity: .5;
filter:alpha(opacity=50);
}

#block {
position: absolute;
top: 0px;
left: 0px;
height: 200px;
width: 200px;
z-index: 1;
}

Obviously you can add any other attributes you wish to the div. This becomes more difficult when you have a div with variable height because you need to repeat the div contents within both the transparent div and the opaque div. I find it is easiest if you limit what attributes you assign to the ID of the div and instead create a class with the shared attributes. So if you want a div with a background of 50% white transparency and a foreground of black bold opaque text it will look like this:

#transblock {
z-index: 0;
opacity .5:
filter:alpha(opacity=50);
background-color: white;
}

#block {
z-index: 1;
}

.block {
position: absolute;
top: 0px;
left: 0px
color: black;
text-decoration: bold;
}

Then when you declare these in XHTML you can use:

<div id="transblock" class="block">

and

<div id="block" class="block">

This way you only have to edit the class to change your layout without having to edit two different IDs. You should notice two things. First that this requires absolute positioning and z-index values to place the opaque text over the tranparent background. Second, I am using the same name for an ID that I use for a class. Normally I would say that this can be confusing but in this situation I think it is actually easier to understand and manipulate the code.

The use of a sperate class is only really needed if you have variable height because otherwise you do not need to repeat the code. The separate class makes sure that the attributes between the transparent div and the opaque div are always the same which ensures the size of the div is maintained whenever attributes or contents are changed within the div. The only time you would actually have to edit the IDs is if you wanted to change the opacity level or the color of the background.

One other thing to note is that IE7's opacity filter only works on elements with a specified height and/or width.

Labels: , , ,

Rhinebeck bi-planes

I posted a picture of the Nieuport 24 that crashed at Rhinebeck a few days ago. Today I will post a few others that I took that day. I regret that my picture of the famous Fokker Dr I triplane, known for it's association with the "Red Baron", did not come out so well so I did not post it. To be honest the Nieuport 24 picture came out the best in my opinion. I was in a hurry with my point and shoot so the pictures aren't great but they are the best ones I took that day.

This first bi-plane is known as the Albatros. It was a very successful German fighter eary in the war and was the type flown by the "Red Baron" before he flew the Fokker Dr I.

Fokker DIII at Rhinebeck Aerodrome, Copyright 2008 Christopher Smith

The "Jenny" as it was known was used to train American pilots during the war and became popular with barnstormers when the war was over and they were sold as surplus.

Curtis JN-4 at Rhinebeck Aerodrome, Copyright 2008 Christopher Smith

The Fokker DVII was a superior aircraft at the time and led to the second "Fokker Scourge".

Fokker DVII at Rhinebeck Aerodrome, Copyright 2008 Christopher Smith

A popular hobbyist bi-plane from the 1930's called the Great Lakes T2-1R. In the distance you can see a New Standard D-25 (left) and a Piper Cub (right).

Great Lakes T2-1R at Rhinebeck Aerodrome, Copyright 2008 Christopher Smith

Labels: ,

Thursday, August 21, 2008

Flash 10 update

Four days ago I installed Flash 10 on my laptop. I was hoping it would solve some of the issues I was having with Flash. Unfortunately I haven't seen many differences at all. I'm not sure if my problems are related to Flash itself or nspluginwrapper but Flash still crashes or hangs my browser occasionally and some Flash videos still don't work, they just display a gray box where the video should be. The good news is that Flash hasn't crashed X yet which started happening on my laptop recently with Flash 9. Also I haven't had any regressions yet so that's good news. I would recommend checking it yourself. I would love to know how well it is working on 32-bit machines.

UPDATE: Shortly after posting this I visited some other flash sites that normally worked with Flash 9 and they were not working correctly. I reverted to Flash 9 for the time being and things are back to "normal".

Labels: ,

Wednesday, August 20, 2008

Linux powersaving tunables

Linux offers many powersaving features but you have to know where to look to enable these features. There is a wealth of information over at LessWatts.org. I have greatly reduced my power consumption by implementing many of their tips. The first place you should start is by enabling cpufreq. This is probably the number one powersaving feature. I would also enable dynticks in the kernel. To get a better idea of how much power you are using make sure to enable the powertop interface in the kernel. Then there are many tunable powersaving features that you can manipulate from userland. Here are examples that I have used.

hal-disable-polling --device /dev/hda

Disables polling of your cdrom drive but without it most drives will not automatically recognize when a CD/DVD is inserted.

echo 5 > /sys/bus/pci/drivers/iwl3945/0000\:03\:00.0/power_level

Turns on powersaving features of the intel 3945 wireless card. Some people have reported that it can cause problems with staying connected to access points. I haven't had much trouble with it.

hdparm -B 1 -S 12 /dev/sda

Enables aggressive powersaving on the hard drive.

echo 1 > /sys/devices/system/cpu/sched_mc_power_savings

Increases CPU idle time which allows you to acheive lower power states.

echo min_power > /sys/class/scsi_host/host0/link_power_management_policy

Enables power managment for SATA.

echo 1500 > /proc/sys/vm/dirty_writeback_centisecs

Increases dirty VM writeback time which allows your HDD to stay spun down for longer periods of time.

In addition to these features the cpufreqd, laptop-mode, and powersave daemons all can help lower your wattage.

Labels: , , ,

Tuesday, August 19, 2008

Bi-plane crash at Rhinebeck Aerodrome

This post is a little offtopic but a couple of weeks ago I went to the Rhinebeck Aerodrome to see a bi-plane airshow. Yesterday I learned that there was an accident on sunday that resulted in the death of one of the pilots. When I read the news and saw that it was the Nieuport 24 that crashed I immediately searched for it amongst the photos I took that day. This picture is forever going to remind me just how fragile life is.

Nieuport 24 at Rhinebeck Aerodrome, Copyright 2008 Christopher Smith

Labels: , ,

Monday, August 18, 2008

Updated sK1 ebuild with gnome USE flag

I've updated my sK1 svn ebuild to include a gnome USE flag. The normal build defaults to Crystal icons. The USE flag patches the configurator.py file to use Tango icons and also changes the fonts. You can edit the patch to use different fonts if you like.

/usr/local/portage/media-gfx/sK1-9999.ebuild

/usr/local/portage/media-gfx/files/gnome-sK1.patch

Labels: , , , ,

Webkit-GTK svn ebuild

I have been very interested in Webkit ever since the GTK port was announced. It seems like a good fit for integration with Gnome applications like Epiphany and Evolution. Right now I'm using it in Evolution-RSS and Midori, a Webkit-GTK browser. There are a couple of svn snapshot ebuilds in portage but I find myself constantly creating new snapshot ebuilds to test out the latest Webkit-GTK along with the svn ebuild of Midori. So in a similar fashion to my sK1 svn ebuild I decided to create a Webkit-GTK svn ebuild. Be forewarned that the checkout process takes a very long time. Based on my genlop output the checkout process alone took 40 minutes and compilation took another 20 minutes.

/usr/local/portage/net-libs/webkit-gtk-9999.ebuild

Labels: , , , , , , , , ,

Sunday, August 17, 2008

Extremely hacked Flash 10 on Gentoo

Flash has always been a problem for me on 64-bit linux. It works ok with Nspluginwrapper but is continually crashing or hanging the browser. It has even started to crash X lately which is just screwed up. So I decided to take Flash 10 beta for a test drive to see if anything is improved but I ran into some stumbling blocks along the way. Nspluginwrapper failed to install the latest flash because it was missing some necessary 32-bit libraries. Fortunately I found that the 32-bit binaries of OpenOffice and Adobe Reader provided the necessary libraries but they were not located in /usr/lib32. I didn't want to mess with the library path so I just symlinked the necessary libraries into /usr/lib32. I logged out and back in again and Flash 10 is working! I'll report back later so see how well this hack stands up and how well Flash 10 performs. If you want to try it out here are a couple of files you might want. Remember that this only works on 64 bit, you need nspluginwrapper, and you must have both the Adobe Reader binary and the OpenOffice binary installed.

This script will symlink the necessary libs into place. It needs to be given execute permission and run as root. Also the script is extremely dumb so check the output for failures:

symlink.sh

This ebuild is just a copy from portage but with a modified version number to get the latest beta released on August 11, 2008:

/usr/local/portage/net-www/netscape-flash/netscape-flash-10_beta20080811.ebuild

Labels: , , , , ,

Evolution-RSS

For years I have been using Liferea for RSS feeds and Evolution for email. After years of searching for information in mailing lists using Evolution then switching to Liferea for RSS I got tired of it and started looking for a RSS plugin for Evolution when I found Evolution-RSS. That was a few months ago when the stable version was 0.0.8. Since then a newer version has been released but not updated in the sunrise overlay. I took the 0.0.8 ebuild and Auke Booij's advice on Gentoo Bugzilla and created this ebuild:

/usr/local/portage/gnome-extra/evolution-rss/evolution-rss-0.1.0.ebuild

The newest Evolution-RSS has the ability to display feeds using either Gecko or Webkit (if installed). You can also use Evolution's excellent search function on your RSS feeds. It makes finding information so much easier. The downsides are that it is still incomplete and I have come across a few crasher bugs (adding a feed within evolution crashes evo for me). Also there is no dbus integration so downloading feeds directly through Epiphany is a no go. You need to manually add feeds using evolution-import-rss.

Labels: , , , , , ,

Weird icon bug

I have beeen using the now defunct gTangish icons for a couple of months now and found a weird problem where icons in 32-bit binaries (I am using 64-bit) like Acrobat Reader, Raw Therapee, and Realplayer displaying larger than life to say the least. No other icon set had this problem. After some investigating I found that it was most likely a index.theme issue. Not wanting to look for the fatal flaw all day I decided I would base a new theme.index off of the gTango icon set which has now taken the place of gTangish. (I don't really like the gTango set as much as gTangish that's why I am still using it). Anyway here is what the problem looked liked:



The modified theme makes everything look normal again:



Here is the modified gTangish theme.index

Labels: , , , ,

Saturday, August 16, 2008

Conky

Conky is a system monitor for Linux. It can be customized in pretty much any way imagineable. This is what my conky looks like:


Here is my .conkyrc

Labels: ,

Friday, August 15, 2008

sK1 svn ebuild

For ten years now UNIX has had a fantastic vector editor called Skencil (formerly Sketch). The bad news is that it hasn't been updated in over 2 years. That's where sK1 comes in. It has a new updated interface along with a cairo backend and CMYK support for use in pre-press. I've been checking out svn versions and the project looks very promising although quite incomplete at the moment. Anyway, I got tired of fetching things manually and adapted an sK1 ebuild I found on the net to fetch the latest svn version. Here it is:

/usr/local/portage/media-gfx/sK1/sK1-9999.ebuild

Labels: , , , , ,

Watch TV on the internet with Miro

If you haven't heard of it yet Miro is an opensource internet TV application available for Linux, Mac, and Windows. It uses RSS feeds to grab torrents and then downloads them for viewing. There are is also a guide to watch free television but what if you want to watch a show that isn't in the guide? There is an easy workaround that should be familiar to you if you use bittorrent already, it's called Mininova.

First you need to navigate to Mininova and search for the show you want to watch. I will use the Daily Show as an example. You will get a list like this:


Click on any actual Daily Show episode. Notice that some results that are displayed are for other shows. When you do click on a torrent it will load another page with links like this at the top of the page:



Click on the show title, in this case "The Daily Show". This will load another page that prominently displays an orange RSS feed link:



Now open Miro and and from the toolbar menu choose Channels->Add a new channel. Use the rss feed for the show you searched for as the URL. That's it. Now you have a channel in Miro that will automatically download the latest feeds.

There are a couple of things to note. While this works quite well for me it isn't without issues. You will tend to get multiple of the same episodes because of the nature of a bittorrent search site. Also Miro isn't exaclty light on resources and it is a bit buggy to boot. The good news, at least for linux users, is that Banshee is going to be incorpoarting the same technology into their 1.4 release due out in September. If you haven't used it Banshee is one of the best media players for Linux and after the aforementioned 1.4 release I believe it will be the best media player hands down on any platform.

For Gentoo users out there here is an ebuild for the latest version of Miro (1.2.6) that I adapted from an ebuild for version 1.2.4 found on the net:

/usr/local/portage/media-tv/miro/miro-1.2.6.ebuild

/usr/local/portage/media-tv/miro/files/setup.py.patch

/usr/local/portage/media-tv/miro/files/MozillaBrowser.sed

Labels: , , , , , , , ,

Fix frequency scaling on Gentoo >=2.6.25

I created this blog for a few reasons. One of those reasons is to document tips, tricks, and workarounds for computer related problems that I have come across. I have been creating notes on my computer to reference these problems but this blog will allow me to not only store my findings on the web but also allow other people to access them should they provide useful. So without futher ado here is my first fix.

First a little background, my OS of choice is Gentoo Linux. Currently I am running a 64-bit kernel with a hardened profile, and a hardened gcc 4.2 from Xake's toolchain overlay. I am using PaX/Grsec for hardening.

The Problem:

After upgrading to kernel with version 2.6.25 or higher frequency scaling stopped working with cpufreqd. After hours of investigating the problem, and a few Gentoo forum posts it was determined that the problem lay with cpufrequtils. In order to work properly cpufrequtils had to be upgraded. Unfotunately there is only one cpufrequtils package in portage and it is quite old.

The Solution:

A new ebuild had to be created for the latest cpufrequtils. I based the new ebuild on the current ebuild only modifying the "epatch" line. Here are the results for anyone who may be experiencing issues with cpu frequency scaling on Gentoo.
/usr/local/portage/sys-power/cpufrequtils/cpufrequtils-004.ebuild

/usr/local/portage/sys-power/cpufrequtils/files/cpufrequtils-conf.d

/usr/local/portage/sys-power/cpufrequtils/files/cpufrequtils-init.d

Labels: , , , ,