The HipHop Compiler from Facebook By Megha Gupta & Nikhil Kapoor.

Slides:



Advertisements
Similar presentations
1 Copyright © 2005, Oracle. All rights reserved. Introducing the Java and Oracle Platforms.
Advertisements

BY: ALBERTO CABEZAS 4/19/2010. INTRODUCTION: PHP is considered today as one of the most famous scripting languages. PHP is widely used as a general purpose.
ASP Tutorial. What is ASP? ASP (Active Server Pages) is a Microsoft technology that enables you to make dynamic and interactive web pages. –ASP usually.
Programming Our First Java Program Yingcai Xiao. What to Do Set up for Java Programming Write our first Java Program with IDE Write our first Java Program.
1 CS6320 – Why Servlets? L. Grewe 2 What is a Servlet? Servlets are Java programs that can be run dynamically from a Web Server Servlets are Java programs.
© Prentice Hall CHAPTER 3 Computer Software.
1 DOS with Windows 3.1 and 3.11 Operating Environments n Designed to allow applications to have a graphical interface DOS runs in the background as the.
Efficient Instruction Set Randomization Using Software Dynamic Translation Michael Crane Wei Hu.
HipHop: High-Performance PHP Ali-Reza Adl-Tabatabai HipHop Team Facebook.
Apache Jakarta Tomcat Suh, Junho. Road Map Tomcat Overview Tomcat Overview History History What is Tomcat? What is Tomcat? Servlet Container.
Types of software. Sonam Dema..
Web Page A page displayed by the browser. Website Collection of multiple web pages Web Browser: A software that displays web pages on client computer.
ITM352 PHP and Dynamic Web Pages: Server Side Processing.
Introduction to Java CSIS 3701: Advanced Object Oriented Programming.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.

Introduction to .Net Framework
Introduction to ASP.NET. Prehistory of ASP.NET Original Internet – text based WWW – static graphical content  HTML (client-side) Need for interactive.
Architecture of.NET Framework .NET Framework ٭ Microsoft.NET (pronounced “dot net”) is a software component that runs on the Windows operating.
PHP TUTORIAL. HISTORY OF PHP  PHP as it's known today is actually the successor to a product named PHP/FI.  Created in 1994 by Rasmus Lerdorf, the very.
JIT in webkit. What’s JIT See time_compilation for more info. time_compilation.
PHP With Oracle 11g XE By Shyam Gurram Eastern Illinois University.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
The Web Architecture and ASP.NET. Slide 2 Review of the Web (1) It began with HTTP and HTML, which delivers static Web pages to browsers which would render.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
Jan Benda Martin Maly Tomas Matousek Ladislav Prosek Pavel Novak Vaclav Novak Tomas Matousek Department of Software Engineering Faculty.
Java 2 security model Valentina Casola. Components of Java the development environment –development lifecycle –Java language features –class files and.
PHP Features. Features Clean syntax. Object-oriented fundamentals. An extensible architecture that encourages innovation. Support for both current and.
Active Server Pages (ASP), also known as Classic ASP or ASP Classic, was Microsoft's first server-side script engine for dynamically generated web pages.
CT1513 Introduction To java © A.AlOsaimi.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
PRIOR TO WEB SERVICES THE OTHER TECHNOLOGIES ARE:.
Chapter 1 Introduction. Chapter 1 -- Introduction2  Def: Compiler --  a program that translates a program written in a language like Pascal, C, PL/I,
PHP Performance w/APC + thaicyberpoint.com thaithinkpad.com thaihi5.com.
 Programming - the process of creating computer programs.
Full and Para Virtualization
CSE 598c – Virtual Machines Survey Proposal: Improving Performance for the JVM Sandra Rueda.
ASP. ASP is a powerful tool for making dynamic and interactive Web pages An ASP file can contain text, HTML tags and scripts. Scripts in an ASP file are.
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
ASP.NET &.NET Environment. Overview Part of Microsoft’s.NET environment Used for Development of  Websites  Internet applications  Web Services & XML.
Slide 6-1 Chapter 6 System Software Considerations Introduction to Information Systems Judith C. Simon.
Sung-Dong Kim Dept. of Computer Engineering, Hansung University Chapter 3 Programming Tools.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
ANDROID OS Ravi Soni MTech (CS) III Sem. W HAT IS A NDROID ? Android is a software stack for mobile devices that includes an operating system, middleware.
Just-In-Time Compilation. Introduction Just-in-time compilation (JIT), also known as dynamic translation, is a method to improve the runtime performance.
Presented By Sushil K. Chaturvedi Assistant Professor SRCEM,Banmore 1.
Diploma of Website Development Getting Started With ASP.NET
Computer System Structures
Applications Active Web Documents Active Web Documents.
COMP 2100 From Python to Java
Outline Introduction to the Phalanger System
Introduction to programming
Self Healing and Dynamic Construction Framework:
Topic: Difference b/w JDK, JRE, JIT, JVM
CASE STUDY 1: Linux and Android
Platform as a Service.
Introduction to Operating System (OS)
Lecture 1 Runtime environments.
Introduction Enosis Learning.
PHP / MySQL Introduction
2.1. Compilers and Interpreters
Introduction Enosis Learning.
Lecture 1 Runtime environments.
Web Servers (IIS and Apache)
Dynamic Binary Translators and Instrumenters
Running C# in the browser
Presentation transcript:

The HipHop Compiler from Facebook By Megha Gupta & Nikhil Kapoor

The HipHop Compiler from Facebook By Megha Gupta & Nikhil Kapoor

Introduction HipHop for PHP o HPHPc o HPHPi o HPHPd o HHVM The Facebook HipHop Gupta & Nikhil Kapoor

Chronology of PHP Became a compiled language with PHP4 Until version3… only Interpreters in vouge PHP 4 introduced the Zend Engine o HPHPi o HHVM The Facebook HipHop Gupta & Nikhil Kapoor

Compiler vs Interpreter Compiler o The entire program must be translated before it can start to run and produce result Interpreter o The interpreter does not translate the source program into object code prior to execution The Facebook HipHop Gupta & Nikhil Kapoor

Advantages of Compilation better execution speed static analysis improved interoperability with code written in other languages The Facebook HipHop Gupta & Nikhil Kapoor

PHP Compilers of note Phalanger Zend Engine PHP static PHC HipHop The Facebook HipHop Gupta & Nikhil Kapoor

Phase 1 - Compiles source code into CIL byte-code Phase 2 - completed by the JIT compiler component of the.NET Framework.JIT.NET Framework Does not address:- o native code generation o optimization The Facebook HipHop Gupta & Nikhil Kapoor

Engine splits the processing of PHP code into several phases. first phase generates Zend opcodes. second phase execute the opcodes. opcodes stored in the server shared memory space. several PHP caching extensions also known as PHP accelerator extensions.PHP accelerator extensions The Facebook HipHop Gupta & Nikhil Kapoor

Engine cond… The Facebook HipHop Gupta & Nikhil Kapoor

(ex. Roadsend PHP) generates standalone binaries or extensions for the Apache Web server. Php scripts run as standalone Apache modules also provides its own Web server The Facebook HipHop Gupta & Nikhil Kapoor

compiles PHP scripts generates PHP extension convert PHP into XML and back The Facebook HipHop Gupta & Nikhil Kapoor

Developed on CentOS and Fedora systems.CentOSFedora Initial release 2 February 2010 Increases the speed of PHP applications by factors of 2 to 6 times. Source code on GitHub The Facebook HipHop Gupta & Nikhil Kapoor

cond… HPHPc o original version of HipHop o source code transformer source code transformer o Was unfriendly to developers o deprecated on 19 February 2013 The Facebook HipHop Gupta & Nikhil Kapoor

cond… HPHPi o developer mode version of HipHop o much less performant than HPHPc o But… enabled developers to use the same stack as production code. The Facebook HipHop Gupta & Nikhil Kapoor

cond… HPHPd o HipHop debugger o keyboard interactive interface o Provides developers with many tools for running code and setting watches. The Facebook HipHop Gupta & Nikhil Kapoor

cond… HHVM o The HipHop Virtual Machine o current version of HipHop o replaced HPHPc and HPHPi The Facebook HipHop Gupta & Nikhil Kapoor

cond… HHVM o compiles PHP source to BytecodePHPBytecode o Bytecode either:-  run in a virtual machine environment, orvirtual machine  compiled at run-time to machine code o uses a custom JITJIT The Facebook HipHop Gupta & Nikhil Kapoor

HipHop Multi-threaded vs Multi-process Web Servers compiles the code into an executable program that works as a multi-threaded Web server. the compiled PHP code o runs faster, and o is more memory efficient. The Facebook HipHop Gupta & Nikhil Kapoor

HipHop Multi-threaded vs Multi-process Web Servers cond… Apache uses Multi-process Web Servers. each request handled by separate OS process. each process has its own memory pool. The Facebook HipHop Gupta & Nikhil Kapoor

HipHop Problem with Multi-process Web Servers When a process uses a large chunk of memory. memory is not returned to the OS until the process exits. waste of memory. The Facebook HipHop Gupta & Nikhil Kapoor

HipHop Problem with Multi-process Web Servers cond… HipHop compiler generates… multi-threaded Web server programs New PHP extensions are thread-safe… this means that… they can run without crashing. The Facebook HipHop Gupta & Nikhil Kapoor

HipHop Tests conducted to evaluate performance of compilers Script named bench.php o Does not execute any I/O operations, like accessing files, networks or database servers. o available from the official PHP development repository. The Facebook HipHop Gupta & Nikhil Kapoor

HipHop bench.php was executed 5 times for each type of PHP compiler environment Reason:- o benchmark was performed on a Linux o Linux is a preemptive multi-tasking environment o shortest execution time The Facebook HipHop Gupta & Nikhil Kapoor

HipHop Results for the different PHP compiler environments that were evaluated:- The Facebook HipHop Gupta & Nikhil Kapoor

HipHop The Facebook HipHop Gupta & Nikhil Kapoor

HipHop The Facebook HipHop Gupta & Nikhil Kapoor

HipHop fastest code generated by PHC and HipHop main difference between these:- o HipHop generates whole Web server executables o PHC generates PHP extensions that can be used in a regular PHP installation based on Zend Engine. o PHC compiled code performs well when enabling optimizer options. o No big difference when trying different optimizer level values for HipHop. The Facebook HipHop Gupta & Nikhil Kapoor

Which Compiler Best for Who ? Very busy sites - HipHop o need many servers to handle all user requests o memory usage efficiency the best Not so busy sites - PHC o provides better speed execution o memory usage efficiency not so great The Facebook HipHop Gupta & Nikhil Kapoor

Thanks! The Facebook HipHop Gupta & Nikhil Kapoor