From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id B8DC3BB9C for ; Fri, 16 Sep 2005 01:21:23 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j8FNLN77011497 for ; Fri, 16 Sep 2005 01:21:23 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id BAA27167 for ; Fri, 16 Sep 2005 01:21:22 +0200 (MET DST) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.202]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j8FNLLWq011492 for ; Fri, 16 Sep 2005 01:21:22 +0200 Received: by zproxy.gmail.com with SMTP id 16so254975nzp for ; Thu, 15 Sep 2005 16:21:21 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=nkIJIvAbc/oG1zGEIS9ASnsZErnfM2dCrO2+rGrBYU7nrcVQbzeVQjRNB+ZDjTyxHXMGGIH5jj0/RxtCzRlx8JsirCJ5tGuo/nooHfGnvohGKZUasVdrmZaqj357imxAAseI1XexZwO1Zu8Lpl5G5ryLk9TW+nFAsSaAcxZ23OQ= Received: by 10.36.221.46 with SMTP id t46mr51000nzg; Thu, 15 Sep 2005 16:21:21 -0700 (PDT) Received: by 10.36.33.7 with HTTP; Thu, 15 Sep 2005 16:21:21 -0700 (PDT) Message-ID: <305c47f0509151621621a630d@mail.gmail.com> Date: Thu, 15 Sep 2005 19:21:21 -0400 From: Jeffrey Mathews Reply-To: Jeffrey Mathews Sender: jeffreymathews@gmail.com To: caml-list@inria.fr Subject: Floating point optimization patch for OCaml bytecode Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Miltered: at nez-perce with ID 432A01F3.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 432A01F1.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml:01 bytecode:01 bytecode:01 ocaml:01 compiler:01 runtime:01 unboxing:01 patched:01 metaocaml:01 short:01 compiles:01 diff:01 optimizing:02 programming:03 optimization:03 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.3 I know, I know -- why bother optimizing bytecode? (Compelling reasons have long been debated -- for me, it's a need to do dynamic- / meta- programming.) Anyway, I've written a small patch for the OCaml bytecode compiler and runtime that significantly improves the performance of a few floating-point intensive benchmarks (from 30 to 40%) by reducing boxing and unboxing of intermediate floating point results. This is still preliminary work, and honestly I'm a little suspicious that it works so well. Testing has also been light -- it compiles and runs my 'benchmark' script when patched against ocaml 3.08.1 and 3.08.4 (as well as MetaOcaml, though the patch needs a little coaxing). A short write-up can be found at http://dem.inim.us/ocamlfp/README-FP.html The patch is found at http://dem.inim.us/ocamlfp/ocamlfp-0.1.diff.gz I'd greatly appreciate feedback, criticism, testing on other platforms. Thanks in advance, Jeff