New toy

wasd-keyboard.jpg

I got a new toy. It’s a WASD keyboard with Cherry MX Clear switches. The picture doesn’t do it justice; maybe I should’ve gotten a new camera instead… I guess it’ll have to wait.

Mechanical-switch keyboards are pricey, but since I spend more than 2000 hours a year in front of a keyboard, it’s not a bad investment. Or so I’m telling myself. Anyway, it’s a big step up from the rubber dome one I’ve been using for the past couple of years. The key travel is longer, and it’s nice to have proper tactile feedback. Since the Clear switches have stiff springs, I can also rest my fingers on the keys when daydreamingthinking. It has anti-slip pads underneath, so it stays put, and it doesn’t bounce or rattle at all.

Until our last move, I clung to an older, clicky keyboard (I don’t remember which brand — I thought it was Key Tronic, but I’ve a hard time finding any clicky keyboards of theirs at the moment), worried that the future held rubber dome and chiclets only — but today, there are lots of options if you look around. I guess we have mostly gamers and aficionados to thank for that. So thank you, gamers and aficionados.

I did plenty of research beforehand, but WASD finally drew me in with this little detail: They have some very well thought-out editable layout templates for SodipodiInkscape. Good taste in software there.

Year of the Linux Desktop Debate

It’s been interesting following the recent discussion about the Linux Desktop and how it failed. It’s a notion that’s been around for some time - I’d say approximately since people tired of discussing whether next year was going to be the Year of the Linux Desktop or so. Painful as it is, it’s also a notion that needs to be discussed, so we can learn from it or at least try to put it to bed.

Sometimes I feel like we’re talking past each other, though. As with any discussion, it’s a good idea to define what we’re talking about:

“Linux”

Most of us use the term “Linux” very loosely (just ask RMS). For instance, it can refer to:

  • Linus’ kernel tree, or the tree of some other well-respected Linux maintainer.
  • GNU/Linux proper, including the much-loved userspace.
  • Anything based on a lightly modified Linux kernel - this is what GNU/Linux distributions tend to ship, but it also appears in routers and all kinds of embedded devices.
  • Anything based on a Linux-derived kernel, including heavily modified/forked Linux kernels - the Android kernel comes to mind.

“Success”

As it happens, we also use the term “success” (and conversely, “failure”) very loosely. It reflects who we are and what we want to achieve with Linux, e.g:

  • Works-for-me. A solution that works well for ourselves and for some of our friends. Also known as “itch-driven development”.
  • Works-for-everyone. We tend to define “everyone” as people who have requirements different from our own - often typified as parents, grandparents, spouses, and so on. Whether these demographics will end up using it is seen as a separate problem. Maybe if you build it, they will come, but it’s not a requirement that they do so.
  • Engineering excellence. A product of inherent beauty, often the result of some design process/criteria, but not necessarily addressing a specific problem. Sometimes you will see this masquerading as works-for-everyone, but you’ll be able to tell it’s about excellence by its uncompromising nature.
  • Commercial ecosystem. A big, commercial ecosystem built around Linux, often expressed as market share or total revenue generated by sales.
  • Big user base. Similar to commercial success in that it emphasizes quantity and popularity, but usually with the aim of enabling freedom/free culture instead of business models.

“Desktop”

This used to mean something like “a top-level graphical user interface with a file browser and application launcher”, but user interfaces have become more diverse, and it might make sense to include media libraries, smartphone interfaces and other environments where you can’t explicitly browse files. We’d have to draw the line somewhere, though - I doubt my router’s configuration UI would make the cut.

What do you want from (GNU/)Linux?

Depending on your perspective, Desktop Linux may be a failure - and if you were expecting to put GNOME in front of a majority of the population of planet Earth, it certainly is.

In many other ways, it’s a success. It’s been a test bed for a very capable free library stack, including GLib, GTK+, Cairo, Pango, D-Bus, GVFS, GStreamer, and more recently, Clutter and Cogl. This is not trivial. The surrounding community has also grown and diversified, and it has nurtured individuals and groups who’ve gone on to do some pretty sterling stuff.

Post scriptum

I think a desktop built on the GNOME platform could still be a moderate commercial success if integrated and marketed skilfully, perhaps tied to some kind of hardware. The window of opportunity hasn’t closed - the UI space is fragmented, Windows 8 is coming out, Valve have announced Steam for Linux (shiny games!) - and our building blocks are better than ever.

Frysja

Maru and Paola just finished uploading their latest short movie, Frysja, and I think it turned out very well! Who needs a budget when you’ve got such great friends?

It’s released under a CC license. Go see it. Sadly, we couldn’t find a way to edit it using Free Software. Maybe some other time…

Chang’e you can believe in

 Chang’e

Laptop case

My sister made me a wonderful laptop case for my birthday - complete with zipper and everything! Thanks, sis.

Laptop case

Hash Table Shootout!

It’s gratifying to see GHashTable faring not-too-badly against an assortment of other hash table implementations in Nick Welch’s excellent benchmarks. I did some work on this previously, but there’s at least one thing that can still be done to reduce its memory footprint on 64-bit architectures. The table is a big array of structs that look like this:

struct _GHashNode
{
  gpointer   key;
  gpointer   value;
  guint      key_hash;
};

The key_hash is useful, as it lets us skip over mismatches and resize the hash table quickly - and on a 32-bit arch, it adds only 4 bytes to every entry, for a total of 12 bytes. However, on a 64-bit arch, it causes entries to be padded so that each entry starts on a multiple of 8 bytes. That wastefulness can be remedied by packing key_hash values in a separate array - as a bonus, entry size becomes a power of two, which means offsets into the array can be calculated using a single shift. On the downside, we’ll incur the added overhead of maintaining two arrays and accessing an extra cache line for each lookup. I suspect it’s still worth it, though.

A couple of open questions/comments on the benchmarks themselves:

  • Google’s dense_hash_map is suspiciously fast at integer deletion - is it shrinking the hash table at all, re-inserting the remaining items as it should? Or does it have some other trick up its sleeve?
  • How robust are the different strategies with respect to poorly distributed keys? E.g. N*2^M spaced integers: 1024, 2048, 3072, 4096, etc.
  • How about poor hash functions supplied by the API user? GHashTable attempts to tackle this by calculating the initial array index modulo a prime number, before applying a quadratic modulo on subsequent probes (faster, and required for quadratic probing).
  • What’s the per-table overhead? How much memory will, say, some 100.000 tables with <100 items each consume? This is not uncommon in practice - nested hashes are often used to store complex properties, and given suitably large working sets, this can become a significant factor for some programs.
  • Are the approaches affected by memory fragmentation? Do they cause it? This is hard to measure; maybe many tables could be grown simultaneously in the same address space.

openSUSE community week

Be sure to check out the openSUSE community week currently underway. The GNOME-centric part of the community has its own program for the week.

Grand Finale México

Since we’re leaving the country for good (or at least for a very long time), we thought it’d be nice to do the full-on tourist thing and take a bunch of pictures - actually the only time we’ve done so in the ten years I’ve lived here - taking a little piece of Mexico with us.

So Maru and I just got back from two weeks of vacations non-essential travel. We’ve had an excellent time, spending the first week in the northern states of Chihuahua and Sinaloa - taking the Chepe train through Copper Canyon territory and reaching an altitude of about 2600m - and the second week on the southern island of Cozumel, scuba diving down to -8m.

The influenza outbreak took us by surprise - we’ve passed through the Mexico City airport three times since the 18th of April, and hope to do so again in another couple of days - but we are apparently both healthy at this point. It’d be a bummer if our flight out gets cancelled or - even worse - if we’re quarantined in Europe, though. Fortunately, the way things are looking now, there isn’t a huge chance of that happening.

On the upside, we had Cozumel almost to ourselves (we were referred to as “the only two tourists left on the island” at least once), as people kept leaving and no more were arriving. I feel bad for anyone working in the tourist business here, though, especially our friend Hilda who lent us her battered charming open VW beetle so we could cruise around the island in style.

Copper Canyon river

One of the rivers winding through the Copper Canyon

SUSE rocks

SUSE rocks (I suspect Bryen will love this)

 El Zorro and I

 Apparently, our hotel in El Fuerte was once the ranch where Don Diego de la Vega, aka El Zorro, grew up. I had no idea!

 Cozumel coastline

Ghost island Cozumel

Mind that face

Can you believe they actually let us through the security checkpoints dressed like this?

Shoveling snow

The snow-shoveling I’ve been taking part in over the last couple of weeks is best described with a set of graphs:

openSUSE boot time improvements on netbook

So far, we’ve been able to lop about 23 seconds - or 48% - off the time it takes to boot openSUSE 11.1 on this particular netbook, without sacrificing much in the way of functionality. It boots straight into GNOME and its usual trappings, including the panel, Nautilus, “slab” main menu, nm-applet, PackageKit updater, printing applet (written in Python…), CUPS, etc.

It’s important to note that this time is measured from the moment bootchart starts until everything settles and is ready to use, easily identified in the chart as the moment where CPU activity falls to the baseline of noise from bootchartd itself.

It’s also important to note that this is on a netbook with a slow CPU, slow-to-init X driver/graphics hardware and fast SSD I/O. I’m hearing a lot of numbers being bandied about these days, e.g. “distribution Foo boots in 10 seconds”, and these numbers are meaningless without hardware specifications and a list of features you get. GNOME delivers a different feature set from Xfce, and netbooks and workstations usually perform very differently. Then there are questions of flexibility; is the system open-ended? Can you get server features by just installing packages and configuring them?

IMO, openSUSE has had unacceptable boot times on workstations for a long time now. Hopefully these changes will make it into future releases, upstream where possible.

For more details, see the wiki page. Note that for various reasons I haven’t been able to keep the text up to date. The graphs are representative, though.

Life update, winter of 2009

Maru and I spent Christmas in Norway this year, and I’ve stayed on a bit to get things organized for our impending relocation here. Circumstances have delayed us, so instead of arriving ahead of the local recession, we’ll be setting up right in the middle of it. One can only hope that Norway will weather it as well as the media will have one believe.

Meanwhile, there’s plenty of things to do besides worrying. For instance, there’s work, which at the moment consists of a kind of snow-shoveling exercise. Then there’s literally shoveling snow - oddly satisfying after so many years in the tropics. Between that and the access to (suitably tame) nature, I might work off the Christmas pounds yet. Apart from that, I’ve gotten to spend some quality time with my grumpy friends - notably, Johannes turned 30.

View from my workspace View from terrace Front porch Maru skiing Johannes turns 30