Computing 2010

pc.jpgToday, I came across an interesting article in the Forbes Magazine entitled “Computing 2010”. The interesting part is that this article was written ten years ago. The author, Kip Crosby, imagined what computers would look like in 2010: optical circuits instead of silicon, with a CPU running at 100 GHz, holographic mass storage offering several TB capacity, 256 GB optoelectronic RAM, biometric authentication, voice control, completely wireless and shaped like a frisbee. Whew! Looks like Kip was just a tad too optimistic. Optoelectronics hasn’t caught on and most computers are still boxy rather than frisbee-ish. In fact, todays’s PC looks pretty much like that of 2000, except that its capacity has increased roughly following Moore’s law. The only accurate prediction is about mass storage capacity, although that didn’t require optical technology.

Personally, I’ve begun the new computing year with a major upgrade, though still far away from Kip’s 2010 vision. I have replaced my 32-bit Windows OS with a 64-bit Linux OS, doubled RAM from 4 GB to 8 GB and added another external USB hard drive for backups. The Ubuntu installation turned out a little difficult, because Linux did not want to cooperate with the BIOS RAID-1 configuration, so I had to switch to SATA mode and wipe out the Windows installation. The rest was easy, however. I used to worry about not being able to make my 3G USB modem work with Linux, but our maid has solved this problem for me. She obliterated the device by putting it into the washing machine. Can’t really blame her for that. I probably shouldn’t have carried the modem in the pockets of my shorts.

Back to the topic. What are the computing trends in 2010? Just off the top of my head: cloud computing is becoming a mainstream technology (or perhaps a mainstream buzz; time will tell). Along with that, virtualisation is now widely used. Supercomputers have broken the petaflop mark and now operate in the range of large clouds (> 1 PFlop). CRT monitors are quickly becoming relics of a past epoch. Single-core CPUs are headed the same way. Functional programming languages are beginning to catch on. 64-bit hardware and software are overtaking 32-bit systems in mainstream IT. Java 7 is announced for 2010. It surely looks like an interesting year.

Performance: Java vs. PHP vs. Scala

The topic of performance of specific programming languages has provided material for endless debates among developers. Proponents of a certain language often cite examples that show their chosen language in a particularly good light. For example, I have come across the claim that PHP and Ruby are performing just as well as Java. Often these claims are supported by nothing but a firm tone of voice and a stern mien.

Thankfully, we have benchmarks. A playful yet credible approach to performance measurement was taken by this website. It contains an array of typical benchmark algorithms implemented in 35 popular (and not so popular) programming languages all running on various Linux servers. There are many complexities involved in measuring programming languages execution speed. The web development arena adds even more complexities. Much depends not only on how the algorithms are implemented, but also on how the compiler and the server are configured. For example, there are different JVMs, there are script caches, accelerators, server tunings, and what not. The languages I’d like to compare here are Java, Scala, and PHP. You will find comparison graphs for each of these below.

Three charts: 1. Java vs. PHP 2. Scala vs. PHP 3. Scala vs. Java Java, Scala, PHP Benchmarks

Three bar groups: 1. Execution time 2. Memory use 3. Size of source code Bar pointing down means: faster performance, lower memory usage, and reduced source size. Basically, these charts confirm what experienced programmers already know. Both, Java and Scala outperform PHP by several magnitudes. To be precise, Java and Scala execute 28 times faster on average.

The performance of Java and Scala is similar, which has to be expected since both languages run on the Java virtual machine. Java gives slightly better performance in some algorithms while its memory requirements are lower. For PHP fans who find these benchmarks disappointing, there is some consolation. PHP appears to be less of a memory hogger, and perhaps more importantly, it performs quite favorably when compared to other dynamic interpreted languages, such as Perl, and Ruby. You can compare more language benchmarks yourself at the following URL:

Moore’s law in full swing

Replacing my old desktop computer with a new Intel Quad2Core machine this Christmas caused me to muse about the recent developments in PC technology. Almost everything in my new computer is now at least twice as powerful. The screen resolution increased from 1024×768 to 1680×1050, memory from 1.5 GB to 4 GB, hard disk capacity from 150 to 650 GB and processor speed from 1.8 GHz to 2.4 GHz. Moore’s law is still in full swing it seems. This new machine has a 64-bit processor instead of a 32-bit processor. It also has 2 (or 4) processors instead of just one. Unlike doubling memory or hard disk space, the latter is a significant update, because doubling the number of processors or their bit width doesn’t happen that often. It’s sort of a meta-Moore cycle.

16-bit computing was predominant at the beginning of my career. My first computer was an Atari ST 1040 with a 32-bit chip which was somewhat ahead of its time. However, it still had a 16-bit bus system. A few years later I purchased a true 32-bit system which was based on an early generation 386 chip. Processor speed was still measured in double-digit MHz rather than in GHz. It took a few years for operating systems and software to catch up and produce 32-bit versions of application and system software. The transition occurred during the early nineties which means the latest shift from 32-bit to 64-bit computing took at least 15 years, as we are now in a period where 64-bit computing emerges. Currently most PCs are still 32-bit systems, however.

What are consumers going to do with all that processing power? Well, playing games, rendering 3D images, and encoding audio and image data, I suppose. But probably most of the CPU cycles on any personal computer -not only on mine- go to waste in an idle loop. The situation is a bit like having an army that spends most of its time marching around the barracks.

Terabyte hard disks on the horizon

The first computer I bought almost exactly 20 years ago had a disk capacity of 720 kB. It was provided by a so-called high-density floppy drive. Somewhat later I added a 40 MB hard disk in 5.25” installation size, which was absolutely lavish for a home computer. Today (mid 2006) the largest commercially available hard disk has a capacity of 750 MB which is roughly one million times that of a 720 kB floppy, or twenty thousand times larger than my first hard disk. The current street price for a 750 GB hard disk is at $400 USD.

This development shows that the 1024 MB hard disk is around the corner and we will soon have to get used to another SI unit called terabyte. In fact, the SI quantity “tera” is misused here, since it refers to the decimal power 10^12, or one trillion, whereas the number of bytes on a terabyte hard disk is actually the power of two 2^40, which amounts to 1,099,511,627,776 bytes.

The IEC has devised the cute sounding name tebibyte for this number in conjunction with gibibyte, mebibyte, and kibibyte for the lower binary quantities. The IEC denomination turned out to be not very popular, however. Have you ever heard anyone speaking of a gibibyte hard disk?

The etymology of the SI quantity specifiers is likewise interesting. They all go back to the Greek language. “Kilo” originates from the Greek khilioi meaning thousand, “mega” comes from the Greek megas which means great or mighty; “giga” or Greek gigas meant giant, and finally tera is the Greek word for monster, which is probably an apt description for a hard disk that large.

Before the monster disk becomes available, there are some technical challenges to master, in particular the challenge of the superparamagnetic effect. The industry’s answer is currently perpendicular recording which aligns bits vertically to the disk surface.

An even newer technology -currently in research state- is heat-assisted-magnetic-recording (HAMR), where a laser beam or a similar energy source heats the disk surface while recording bits. This reduces the required strength of the magnetic field and magnetisation can thus be achieved at a higher density.

There is a problem, though. The disk’s lubricant unfortunately evaporates at these temperatures, which is why the industry is now researching self-lubricating disks that use embedded nano tubes to store replacement lubricant. This technology would allow multi-terabyte hard disks to become a reality. This is probably just a few years away from us.