Stories
Slash Boxes
Comments

SoylentNews is people

posted by n1 on Wednesday December 31 2014, @08:37AM   Printer-friendly
from the drum-machine-vst dept.

It’s been shown that even small delays in response time on websites can result in sharp declines in user retention. Now Ori Livneh writes on the Wikimedia Blog that over the last six months the Wikimedia Foundation has deployed a new technology that speeds up MediaWiki, Wikipedia’s underlying PHP-based code using a just-in-time compiler. HipHop Virtual Machine (HHVM) , an open-source virtual machine designed for executing programs written in Hack and PHP, reduces the median page-saving time for editors from about 7.5 seconds to 2.5 seconds, and the mean page-saving time from about 6 to 3 seconds which with than 100 million edits in 2014, means saving a decade’s worth of latency every year.

PHP is a dynamic, interpreted language, so it has the inherent performance disadvantage all interpreter languages have when compared to compiled languages such as C. HHVM is able to extract high performance from PHP code by acting as a just-in-time (JIT) compiler, optimizing the compiled code while the program is already running. The basic assumption guiding HHVM’s JIT is that while PHP is a dynamically typed language, the types flowing through PHP programs aren’t very dynamic in practice. HHVM observes the types present at runtime and generates machine code optimized to operate on these types. HHVM still fulfills the role of a PHP runtime interpreter, serving requests immediately upon starting up, without pre-compiling code. But while running, HHVM analyzes the code in order to find opportunities for optimization. The first few times a piece of code is executed, HHVM doesn’t optimize at all; it executes it in the most naive way possible. But as it’s doing that, it keeps a count of the number of times it has been asked to execute various bits of code, and gradually it builds up a profile of the “hot” (frequently invoked and expensive to execute) code paths in a program. This way, it can be strategic about which code paths to study and optimize.

According to Livneh, in addition to the improved response time the CPU load on MediaWiki's app servers has dropped drastically, from about 50% to 10%. MediaWiki IT "has been able to slash their planned purchases for new MediaWiki application servers substantially, compared to what would have been necessary without HHVM."

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 2) by CRCulver on Wednesday December 31 2014, @01:32PM

    by CRCulver (4390) on Wednesday December 31 2014, @01:32PM (#130514) Homepage

    It’s been shown that even small delays in response time on websites can result in sharp declines in user retention.

    I don't doubt that this development will prove useful for certain websites, but surely Wikipedia was only a testbed for this and no one is suggesting it really needed the development. Wikipedia has progressively become the internet's one-stop shop to find out any information imaginable, and the idea that users would get frustrated by load times and go somewhere else is laughable.

    Starting Score:    1  point
    Karma-Bonus Modifier   +1  

    Total Score:   2  
  • (Score: 2) by c0lo on Wednesday December 31 2014, @02:02PM

    by c0lo (156) Subscriber Badge on Wednesday December 31 2014, @02:02PM (#130519) Journal

    and the idea that users would get frustrated by load times and go somewhere else is laughable.

    Laughable you say? (shudders) ...what if they go to Facebook?

    --
    https://www.youtube.com/watch?v=aoFiw2jMy-0 https://soylentnews.org/~MichaelDavidCrawford
    • (Score: 0) by Anonymous Coward on Thursday January 01 2015, @11:18AM

      by Anonymous Coward on Thursday January 01 2015, @11:18AM (#130750)

      what if they go to Facebook?

      fortunately Facebook uses HHVM too

  • (Score: 2) by datapharmer on Wednesday December 31 2014, @06:11PM

    by datapharmer (2702) on Wednesday December 31 2014, @06:11PM (#130579)

    Or they could have just enabled zend opcache and saved a llot of development time and complexity...