Showing posts with label Firefox. Show all posts
Showing posts with label Firefox. Show all posts

Wednesday, June 25, 2014

Windows Browser Benchmarks

Ok, so this a bit off topic for this blog as it isn’t really a how-to, but I thought it might be interesting to my audience nonetheless. I ran the major browsers through four different benchmarks: Google’s Octane 2.0, Mozilla’s Kraken 1.1, and Apple’s new JetStream and Speedometer (the latter focuses on measuring the responsiveness of web apps by simulating user interactions). For graphing purposes, I normalized the scores on the various benchmarks so that the fastest browser was always 100 (this also means inverting scores for Kraken, which measures time rather than some unit of speed).

To make things interesting, I decided to include some less common variants, as well as the major browsers. I have been hearing about optimized Firefox-derivatives like Pale Moon and Waterfox and wanted to see how they stack up. Here is what I found:



The official Mozilla build was generally faster, although Waterfox was a bit ahead on the Kraken. Pale Moon was consistently last. Both Waterfox and Pale Moon are based on older versions of Firefox. Apparently, the optimizations don’t make up for the improvements in newer versions of Mozilla Firefox, at least not at this time.

And here is how Mozilla Firefox stacks up against other major browsers:


Firefox was the leader except on Octane, where it was pretty close behind Chrome and Opera (which is now based on Chrome, hence the very similar scores). Internet Explorer was consistently near the bottom, losing on both Octane and the Kraken by a wide margin. Although it wasn’t last on Speedometer and JetStream, even coming in second on Speedometer, it was still nearer the bottom than it was to catching Firefox in the lead.

And here I put them all on one chart for a more complete overview:


Finally, I decided to do a combined comparison by looking at how far behind the lead each browser was on each benchmark. This graph is like a target with the bullseye in the center. A browser that was fastest on all benchmarks would be dead center, and the one losing by the widest combined margin would be furthest from the center:

Here we can see that Firefox was the clear winner. Waterfox still outperformed Chrome and Opera, while Pale Moon fell behind them. Internet Explorer was clearly last. Note, however, that the benchmarks are not really meant to be combined in this way and you could probably easily shift these rankings by choosing different benchmarks. Nevertheless, I think the results are interesting.

And for anyone who is particularly interested, here are the original numbers:


Octane Kraken Speedometer JetStream
Firefox 30 9169 3709.8 25.57 65.589
Pale Moon 24 7005 4413.8 19.15 57.805
WaterFox 28 8483 3405.5 21.5 62.103
Chrome 35 9698 3824.3 16.1 55.168
Opera 22 9551 3853.7 15.7 46.022
Internet Explorer 11 6416 6286.4 18.14 50.282

Sunday, September 8, 2013

Installing APNG Assembler (apngasm) on Debian Wheezy

Why you would use animated PNG instead of GIF

If you are reading this post, it is likely you may already know the virtues of APNG, but in case you've found this an aren't sure let me give a quick explanation. While animated PNGs are not as widely supported as animated GIFs, they are technically superior. GIF files support only 256 colors, while PNG supports 16,777,216. PNG files support alpha transparency, which means that parts of the image can be semi-transparent. With GIF files, a pixel is either completely transparent or completely opaque, which results in jagged outlines on images with transparency when the background is unknown. You can see the differences for yourself with this demonstration.

Unfortunately, as previously mentioned, support for APNG is somewhat limited. It was developed by Mozilla and has been supported by Firefox since 3.0. Opera supported it from 9.5-12.1, but unfortunately they gave up support for APNG when they moved from their own Presto engine to the Blink (formerly WebKit) engine used by Chrome. It is not natively supported by Chrome, currently the most popular browser in use, but there is an extension that will add support for APNG.

So, if you want the widest support, you may still want to use an animated GIF. But if you want quality, you need APNG and you can suggest your users try Firefox or the APNG extension for Chrome.

Installing APNG Assembler on Debian

APNG Assembler, or apngasm on the command-line, is a simple tool for creating APNGs from a series of PNG files. However, you might notice that it is not available in the official Debian repositories for Wheezy. The project has a Linux binary, but it didn't work for me on Debian Wheezy. However, building it from source is incredibly simple. Go to the project files on sourceforge, select the latest version, and download apngasm-x.x-src.zip. Then use the following commands (these work for 2.7, adjust accordingly if using a newer version):

unzip apngasm-2.7-src.zip
make
sudo cp apngasm /usr/local/bin


Now apngasm is installed and ready for use. (Note that you must be in the sudo group to use the last command.)

Usage

APNG Assembler doesn't come with a man page, but the command is documented in the readme.txt that comes with the source. Nevertheless, here is a quick overview.

 In order to make an animated PNG, you need a series of PNG images whose names end with sequential numbers, like this:

frame01.png
frame02.png
frame03.png


and so forth.

Basic usage is:

apngasm animation.png frame*.png

This produces an animated PNG that loops at 10 frames per second forever. If you want to change the delay between frames, you add two number to the command that represent a fraction of a second delay time. So, to produce an animated PNG that loops at 25fps (1/25 second delay) you would use:

apngasm animation.png frame*.png 1 25

If you what the animation to loop a limited number of times and then stop, you can use the /l options like this:

apngasm animation.png frame*.png /l2

This will cause the animation to play through twice, and then stop.

For backwards compatibility, animated PNGs can be displayed as a regular, non-animated PNG, but only the first frame will be shown. However, animated PNG also has a feature that allows you to skip the first frame. This way, you can use the first frame to display a thumbnail to non-supporting applications while omitting it from the animation. This thumbnail could be a single frame from the middle or end of the animation, possibly with a message informing the viewer that the image contains an animation their browser or viewer is not able to display. Once you have created this thumbnail as your first frame, simply add the /f option:

apngasm animation.png frame*.png /f

Now the first frame will be displayed for viewers that don't support APNG, but omitted from the animation.

Now you are ready go and fill the internet with much better animated images!

Wednesday, July 24, 2013

Installing official Mozilla builds of Firefox and Thunderbird on Debian

The Debian GNU/Linux distribution includes their own versions of Firefox and Thunderbird, rebranded as Iceweasel and Icedove, which are maintained with security updates for the life of the release. However, some people prefer to use the official Mozilla releases to get the most up-to-date versions. They come in a simple archive file that you can unpack and run right from your home directory, but what if you want to install them system-wide and have them included in the applications menu? Here is how I do it.

First, download the appropriate tarball for your system. The 32-bit builds are easy enough to find (see links above), but if you want to get a 64-bit build they can be found at https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=en-US and https://download.mozilla.org/?product=thunderbird-latest&os=linux64&lang=en-US (note the locale at the end). Simply place the unpacked directories in /usr/local/bin.

The easiest way to keep Firefox and Thunderbird up-to-date is to use the built-in automatic update feature. In order for this to work, Firefox and Thunderbird need to be owned by a user who will actually run them on a regular basis. In my case, they are owned by my user account. Other users who have an account on my machine can use them, but all of the updates get installed by my user. You can just chown -R user /usr/local/bin/firefox, etc.

Now we just need to get them put into the applications menus. For this, we just need to put .desktop files in /usr/local/share/applications.

firefox.desktop should look something like:

[Desktop Entry]
Type=Application
Name=Firefox
GenericName=Web Browser
Exec=/usr/local/bin/firefox/firefox %u
Icon=/usr/local/bin/firefox/browser/icons/mozicon128.png
Comment=Browse the World Wide Web
Terminal=false
X-MultipleArgs=false
Categories=Network;WebBrowser;
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;
StartupWMClass=Firefox-bin
StartupNotify=true


thunderbird.desktop should look something like:

[Desktop Entry]
Type=Application
Name=Thunderbird
GenericName=Mail Client
Exec=/usr/local/bin/thunderbird/thunderbird %u
Icon=/usr/local/bin/thunderbird/chrome/icons/default/default256.png
Comment=Read/Write Mail/News with Thunderbird
Terminal=false
X-MultipleArgs=false
Categories=Network;Email;News;GTK;
MimeType=message/rfc822;x-scheme-handler/mailto;
StartupWMClass=thunderbird-bin
StartupNotify=true


For KDE 4, you may need to run kbuildsycoca4 to update the menus. Now you should see the official builds of Firefox and Thunderbird in the applications menus.

 Firefox icon on Gnome 3 menu on Debian Wheezy

Firefox and Thunderbird icons on KDE 4 menu on Debian Wheezy

Update: I now have a video on DailyMotion demonstrating these steps.