Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Re: [Caml-list] SafeUnmarshal: questions/problems/timings
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Hendrik Tews <tews@c...>
Subject: Re: [Caml-list] SafeUnmarshal: questions/problems/timings

Here is the promised followup with more details on the slow safe
unmarshalling. On you can
download 281 KB of marshalled data. On my machine it takes 23
seconds to check with native code.

The data is of type 

  annotated translationUnit_type = annotated * annotated topForm_type list 

You can test it with the following piece of code:

open Cc_ast_gen_type
open Ast_annotation

let file = "/home/tews/src/elsa/elsa/in/big/nsUnicodeToTeXCMRt1.i.oast"

    [^ annotated translationUnit_type ^]
    (open_in file);
  print_endline "OK"
  | _ -> print_endline "FAIL"

compile with

        ocamlopt.opt safeUnmarshal.cmxa \

The additional files are from Olmar, get them here:

To produce graphs like
you need to download Olmar, compile it and then
- ./regrtest -ocaml  in subdir elsa
- ./regtest-oast | grep time >data in subdir asttools
- gnuplot plot

where the plot file is something like


set grid
unset mouse
set terminal x11 persist
#set terminal postscript enhanced color

set xlabel "size (Bytes)"
set ylabel "time (s)"
set key left

z = 2.1

plot "data" using 6:3 title "SafeUnmarshal user time", \
	(0.000017088 * x) ** 2.1