Your feedback is important to keep improving our website and offer you a more reliable experience.


By David Stewart on August 27, 2015


It always causes me exquisite pain to see someone laboriously copying down a long number from their computer screen, just to type it in to another window or application. Doesn't it for you?

After all, doesn't everyone know about the cut-copy-paste keys? I'm talking about selecting text with your cursor and using control-C for copy and control-V for paste.

I'm not trying to be a technology snob here, since evidently there are many who don't know this simple shortcut feature to make their lives easier. Think about the countless hours of wasted time, errors and drudgery saved by such a simple feature?

Intel® for its part invests countless hours and billions of transistors to add features in our silicon products which will speed up people's lives. If only they knew how to take advantage of it! Part of our job in dynamic languages is what I call "putting the cookies on the bottom shelf". Make this advanced technology easily consumable, and show you the value of it so you can be sure to use it. In response to my earlier blog post, someone on social media commented: "Aside from the horror of smashing through several layers of abstraction to optimize scripting languages with a CPU feature, I'm curious how you might go about it. I hope the answer isn't just "throw more cache at it" :-)"

This was such an apt comment that I thought I would write today about this topic.

In fact, there are a host of new chip features which we can make use of right away, and we have. I hope to go into more detail in future, but here are a few simple examples:

  • In our Xeon processor formerly codenamed "Haswell" (and now called Intel® Xeon v3 processors) we introduced a set of wide vector instructions called Advanced Vector extensions, or AVX2. We noticed that just by compiling the HHVM code with AVX2 enabled, we instantly got a nice performance boost of 5% [1] on a multi-threaded Wordpress workload. That was easy! (Our current work is available in the HHVM v3.8 release as well as some earlier ones).
  • By hand-coding the assembly-level code for memset() and memcpy() in HHVM, we were able to achieve some nice performance boosts in Haswell-based servers as well. We're doing these same kinds of optimizations in Python (both v2.7 and v3.5), PHP (the new and awesome v7) and Go (v1.5) with really nice performance impact.
  • There are some very interesting features in Intel processors and platforms which we are considering adding some support from dynamic languages. Much of this might be invisible to the programmer, though we might add libraries and extensions which will make it possible to choose to use these technologies in special instances. Often these extensions will require a lot of software engineering work on our part, both code changes as well as performance measurement and analysis. 
  • Although our newer generations of CPU's do include features like larger caches, larger TLB's and faster instruction handlers, we get a lot of insight into how dynamic languages behave on these new architectures. This results in ideas we get for tuning at the source level to run better and faster on these architectures.

[1] Intel® technologies' features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. No license (express or implied, by estoppel or otherwise) to any intellectual property rights is granted by this document. Intel disclaims all express and implied warranties, including without limitation, the implied warranties of merchantability, fitness for a particular purpose, and non-infringement, as well as any warranty arising from course of performance, course of dealing, or usage in trade. This document may contain information on products, services and/or processes in development. Contact your Intel representative to obtain the latest forecast, schedule, specifications and roadmaps. The products and services described may contain defects or errors known as errata which may cause deviations from published specifications. Current characterized errata are available on request.

Source: Intel Software | Article: Exposing Processor Features to Dynamic Languages by David Stewart (Intel)