English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
OCamlJit 2.0
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-11-24 (07:59)
From: Yoann Padioleau <padator@w...>
Subject: Re: [Caml-list] OCamlJit 2.0

On Nov 23, 2010, at 11:20 PM, Alain Frisch wrote:

> On 11/19/2010 8:46 PM, Dario Teixeira wrote:
>> Actually, Facebook has a compiler that transforms PHP source code into C++ [1],
>> and they claim a 50% reduction in CPU usage.
> I haven't looked into this project, but I've a hard time believing this is a better approach than compiling PHP to Javascript.

Web browsers have to implement a JIT: they don't have any control on the javascript they get (it can come from anywhere).
This is less true for server-side scripting languages. In the case of Facebook the PHP compiler has access to the whole
PHP codebase and can do some whole-program analysis.

> The translation would probably produce quite idiomatic Javascript code on which modern
> interpreters do an amazing job (and they keep improving). These interpreters focus on optimizing what made naive Javascript interpreters so slow and I assume the typical PHP interpreter has poor performance for the same reasons.
> -- Alain