HipHop für PHP

Der Schleier wurde gelüftet: Facebook hat mit »HipHop« einen Source Code Umwandler veröffentlicht, der PHP-Code in höchst-optimierten C++ Code konvertiert. Dieser wiederum wird dann mit g++ kompiliert um maximale Performance zu erreichen.

Bei Facebook brachte der Einsatz von HipHop eine durchschnittliche Reduzierung der CPU-Auslastung um 50% – natürlich abhängig von der jeweiligen Seite. Für Facebook bedeutet weniger CPU-Last weniger Server – und damit weniger Kosten. Aber natürlich bedeutet weniger Auslastung auch weniger Energieverbrauch.

In seinem Blog-Beitrag schreibt Haiping Zhao »We are proud to say that at this point, we are serving over 90% of our Web traffic using HipHop, all only six months after deployment.

How HipHop Works
The main challenge of the project was bridging the gap between PHP and C++. PHP is a scripting language with dynamic, weak typing. C++ is a compiled language with static typing. While PHP allows you to write magical dynamic features, most PHP is relatively straightforward. It’s more likely that you see if (…) {…} else {..} than it is to see function foo($x) { include $x; }. This is where we gain in performance. Whenever possible our generated code uses static binding for functions and variables. We also use type inference to pick the most specific type possible for our variables and thus save memory.

[…]

Overall HipHop allows us to keep the best aspects of PHP while taking advantage of the performance benefits of C++. In total, we have written over 300,000 lines of code and more than 5,000 unit tests. All of this will be released this evening on GitHub under the open source PHP license.

Der ganze Artikel (englisch) im Facebook Blog: http://developers.facebook.com/news.php?blog=1&story=358

Sexy Album Overlays

Rogie King hat in seinem Blog ein sehr schönes Template für die Darstellung von Musik-Hüllen im Web erzeugt. Es gibt ein CD-Jewel-Case, eine CD und eine Schallplatte (Vinyl mit Hülle). Die Dateien (HTML, CSS, Bilder) hat er freundlicherweise auch zum Download zur Verfügung gestellt.

album_banner.jpg

February 13th, UNIX Time Will Reach 1234567890

February 13th, UNIX Time Will Reach 1234567890: „mikesd81 writes ‚Over at Linux Magazine Online, Jon maddog Hall writes that on Friday the 13th, 2009 at 11:31:30pm UTC UNIX time will reach 1,234,567,890. This will be Friday, February 13th at 1831 and 30 seconds EST. Matias Palomec has a perl script you an use to see what time that will be for you: perl -e ‚print scalar localtime(1234567890),’\n‘;‘ Now, while this is not the UNIX epoch, Alan Cox does assure us that Linux is now working on 64-bit time, and the UNIX epoch ‚roll-over‘ would happen about the time that the sun burnt out.'“

(Via Slashdot.)

Die Sendung wurde leider beschädigt…

Als Versender hat man immer wieder Freude mit seinen Transporteuren. Bei vielen hundert Sendungen im Jahr kommt es doch schon mal vor, dass ein Päckchen auf dem Postweg beschädigt wird. Es kann auch vorkommen, dass eine Sendung vom Empfänger nicht abgeholt wird – und daher zurückgesendet wird. Und leider kommt es manchmal vor, dass der Zusteller diese Retoure kommentarlos in den Flur wirft. Das schützt schließlich vor unangenehmen Rückfragen. Wenn alles das zusammenkommt, dann sieht das Ergebnis so aus (und ist mit dem liebevollen Hinweis auf die wenig offensichtliche Beschädigung versehen…):

Beschaedigte Sendung in Plastikhuelle
Zum Vergrößern Bild anklicken