Optimizing Web Performance with TBB

Full Video of the presentation at LCA2012 (Ballarat, Australia, 17 January 2012)

This paper explains Open Parallel’s success on bringing TBB (a C++ threading library) to the web application developers working on script languages.

It explains the work we did in Perl and PHP, how we integrated TBB functionality into WordPress by running WordPress into HipHop and we present demos that can be played with at http://geopic.me

Download free white paper here


TBB in WordPress

Download TBB in WordPress Oct.2010
Comment on the blog entry


WordPress on HipHop

Download WordPress on HipHop Nov.2010
Comment on the blog entry


(Integration of Intel’s Threading Building Blocks into Facebook’s HipHop)

Paper accepted to be presented at Linux Conference Australia LCA2011 in Brisbane, Australia 24-29 Jan’11


Hardware companies take the lead by shipping only Multicore processors as the standard for the industry. It is their solution to the power wall: reducing the operating voltage while making transistors smaller and faster. By using Multicore chips they will avoid that your latest laptop will burn your lap. Chip designers are concentrated now on gathering together lots of cores in a single chip: 4 cores are the norm today and chips with dozens and even hundreds of cores are already available or to be launched in the following few years.

But chipmakers forgot to check if the software that will exploit this massive processing power was available. Programmers now need to invent ways to write applications that take advantage of this increasing number of cores without spending too much time developing them or lowering its quality and performance. Not to mention how decades of legacy code will perform in the new hardware.

Is this context we established Open Parallel, a group that is working to create an ecosystem of developers, academia and industry to further multicore processing into the mainstream. The presentation will show the evolution and milestones that happened since 2005, but will focus on a current project: TBB into HipHop.

“Intel® Threading Building Blocks (TBB) is an open source library that helps to take advantage of multicore processor performance. It offers an approach to expressing parallelism in a C++ program.”

“HipHop for PHP transforms PHP source code into highly optimized C++. It was developed by Facebook and was released as open source in early 2010.”

At the beginning of 2010 we teamed up with Intel to get the word out about their TBB. Around that time, Facebook released their HipHop engine. We agreed to implement TBB into the HipHop engine as a first project to get our team working on TBB. We are now at a stage where we contributed back code to the community with some TBB features exposed and ready to implement in PHP projects via the HipHop engine.

In July 2010 we announced our HipHop branch/extension that aims to push the integration of TBB’s library into HipHop beyond the already utilized data structures (such as the concurrent_hash_map). In particular we are looking to get some parallel functionality exposed to PHP itself through this extension. We have already had some initial success with a parallel_for implementation that can be used from PHP scripts using a familiar API (Aligned with the C++ API but slightly modified to better suit PHP style).

Our repository can be found at http://github.com/OpenParallel/hiphop-php, the extension is simply named tbb, and can be found in the usual paths in the source tree.

This experiment gave us some deeper insights into how parallel programming with TBB works and how we can start helping others use these technologies. At the time of writing the abstract, we are porting WordPress to HipHop with the new TBB-HipHop commands. We aim to show our code and full results at LCA2011