caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Reducing boxing for floats
@ 2012-03-28 17:29 Alain Frisch
  2012-03-29 18:11 ` Dario Teixeira
  0 siblings, 1 reply; 2+ messages in thread
From: Alain Frisch @ 2012-03-28 17:29 UTC (permalink / raw)
  To: caml-list

Dear caml-list,

I'd like to ask for the community help in evaluating the benefits of a 
new strategy to control boxing/unboxing of floats in ocamlopt.

I've implemented this new strategy in the more_unboxing branch of the 
SVN. You can find some description (and micro-benchmarks) there:

http://caml.inria.fr/mantis/view.php?id=5204


If numerical code is the bottleneck of one of your applications, it 
would be helpful if you could you try out the more_unboxing branch 
(forked from the trunk in january 2011, IIRC) and report the results on 
Mantis.

Thanks!


Alain

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Caml-list] Reducing boxing for floats
  2012-03-28 17:29 [Caml-list] Reducing boxing for floats Alain Frisch
@ 2012-03-29 18:11 ` Dario Teixeira
  0 siblings, 0 replies; 2+ messages in thread
From: Dario Teixeira @ 2012-03-29 18:11 UTC (permalink / raw)
  To: Alain Frisch, caml-list

Hi,

> I'd like to ask for the community help in evaluating the benefits of a new
> strategy to control boxing/unboxing of floats in ocamlopt.

Thanks for this!  I've given the 'more_unboxing' branch a brief try, using
the N-body problem from the infamous shootout as benchmark.  Below are the
results for executables compiled with 3.12.1, today's SVN trunk, and today's
'more_unboxing' branch.  The compiler options are the same as used in the
shootout; the tests consisted of 10^9 iterations on an x86_64 machine:

Version 3.12.1:

 time ./nbody.native 1_000_000_000
 1111.23user 0.13system 18:32.61elapsed 99%CPU (0avgtext+0avgdata 3472maxresident)k
 0inputs+0outputs (0major+273minor)pagefaults 0swaps

SVN trunk (2012/03/29):

 time ./nbody.native 1_000_000_000
 969.29user 0.62system 16:14.66elapsed 99%CPU (0avgtext+0avgdata 3488maxresident)k
 0inputs+0outputs (0major+273minor)pagefaults 0swaps

SVN branches/more_unboxing (2012/03/29):

 time ./nbody.native 1_000_000_000
 960.72user 0.30system 16:03.51elapsed 99%CPU (0avgtext+0avgdata 3472maxresident)k
 0inputs+0outputs (0major+272minor)pagefaults 0swaps

Though the improvement from trunk to more_unboxing is small (about 1%) and
may in fact disappear altogether if one were to run a serious statistical
analysis, the improvement from 3.12.1 to 4.00 is quite striking: about 13%!
What has changed in the compiler that would explain this?

Also, a note to those using GODI: it's fairly straightforward to have multiple
co-existing OCaml installations, making the test of trunk or experimental
branches less disrupting.  You'll find at the end the steps I used to get the
'more_unboxing' branch running.  (Note that I had to run each godi_make step
individually because of step 6, though I'm sure the GODI ninjas will find
ways to streamline this process even further.)

Best regards,
Dario Teixeira

============================================================================

1) Tell GODI the SVN location to checkout.
   Edit $GODI/etc/godi.conf:

  OCAML_SVN_CHECKOUT = yes
  OCAML_SVN_PATH = /ocaml/branches/more_unboxing

2) cd $GODI/build/godi/godi-ocaml-src

3) godi_make clean

4) godi_make fetch

5) godi_make extract

6) GODI expects the source code directory to be called 'work/ocaml'.
   So we must do some renaming before proceeding:

  mv -T work/more_unboxing work/ocaml

7) godi_make patch

8) godi_make configure

9) godi_make build

10) godi_delete godi-ocaml-src-3.12.1godi1

11) godi_make install

12) godi_make package

13) Start godi_console and mark package godi-ocaml for rebuilding.
    This will automatically force an overall rebuild.

14) Enjoy! 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-29 18:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-28 17:29 [Caml-list] Reducing boxing for floats Alain Frisch
2012-03-29 18:11 ` Dario Teixeira

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).