From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 52680BBBB for ; Thu, 14 Sep 2006 15:06:14 +0200 (CEST) Received: from pandora.cs.kun.nl (pandora.cs.kun.nl [131.174.33.4]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id k8ED6DxI017457 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Thu, 14 Sep 2006 15:06:14 +0200 Received: from tandem.cs.ru.nl [131.174.142.18] (helo=tandem.cs.ru.nl) by pandora.cs.kun.nl (8.13.7/5.9) with ESMTP id k8ED677l013757 for ; Thu, 14 Sep 2006 15:06:07 +0200 (MEST) Received: from tews by tandem.cs.ru.nl with local (Exim 4.63) (envelope-from ) id 1GNqwP-00005s-8f for caml-list@inria.fr; Thu, 14 Sep 2006 15:07:41 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17673.21533.259925.817603@tandem.cs.ru.nl> Date: Thu, 14 Sep 2006 15:07:41 +0200 To: caml-list@inria.fr Subject: Re: [Caml-list] SafeUnmarshal: questions/problems/timings From: Hendrik Tews X-Scanned-By: MIMEDefang 2.56 on 131.174.33.4 X-j-chkmail-Score: MSGID : 450953C5.000 on concorde : j-chkmail score : X : 0/20 1 X-Miltered: at concorde with ID 450953C5.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; timings:01 hendrik:01 tews:01 tews:01 followup:01 annotation:01 endline:01 endline:01 ocamlopt:01 cmxa:01 annotation:01 util:01 ctype:01 util:01 ctype:01 Here is the promised followup with more details on the slow safe unmarshalling. On http://www.cs.ru.nl/~tews/nsUnicodeToTeXCMRt1.i.oast 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" ;; try SafeUnmarshal.from_channel [^ annotated translationUnit_type ^] (open_in file); print_endline "OK" with | _ -> print_endline "FAIL" compile with ocamlopt.opt safeUnmarshal.cmxa ast_annotation.ml elsa_util.ml \ ml_ctype.ml cc_ml_types.ml cc_ast_gen_type.ml justunmarshal.ml The additional files are from Olmar, get them here: http://www.sos.cs.ru.nl/cgi-bin/~tews/olmar/viewvc-patch.cgi/elsa/elsa/ast_annotation.ml?revision=olmar-release-2006-09-07 http://www.sos.cs.ru.nl/cgi-bin/~tews/olmar/viewvc-patch.cgi/elsa/elsa/elsa_util.ml?revision=olmar-release-2006-09-07 http://www.sos.cs.ru.nl/cgi-bin/~tews/olmar/viewvc-patch.cgi/elsa/elsa/ml_ctype.ml?revision=olmar-release-2006-09-07 http://www.sos.cs.ru.nl/cgi-bin/~tews/olmar/viewvc-patch.cgi/elsa/elsa/cc_ml_types.ml?revision=olmar-release-2006-09-07 http://www.sos.cs.ru.nl/cgi-bin/~tews/olmar/viewvc-patch.cgi/elsa/elsa/cc_ast_gen_type.ml?revision=olmar-release-2006-09-07 To produce graphs like http://www.cs.ru.nl/~tews/marshal-plot.eps 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 reset 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 Bye, Hendrik