Commit ce339635 authored by Pietro Abate's avatar Pietro Abate

[r2003-06-07 16:55:57 by cvscast] Benchmarks

Original author: cvscast
Date: 2003-06-07 16:55:57+00:00
parent 4871dccc
open Printf
let time_cmd = "/usr/bin/time"
let cduce_cmd = "../cduce"
let xduce_cmd = "/home/frisch/xduce-0.4.0/xduce.opt"
let xslt_cmd = "xsltproc"
let gen = ""
let xml = "split"
let cduce = [ ""; ""; "" ]
......@@ -11,28 +16,39 @@ let langs =
"CDuce", cduce,
(fun script xml ->
sp "../cduce --quiet %s --arg %s" script xml);
sp "%s --quiet %s --arg %s" cduce_cmd script xml);
"XDuce", xduce,
(fun script xml ->
sp "/home/frisch/xduce-0.4.0/xduce.opt %s %s" script xml);
sp "%s %s %s" xduce_cmd script xml);
"XSLT", xslt,
(fun script xml ->
sp "xsltproc --noout %s %s" script xml);
sp "%s --noout %s %s" xslt_cmd script xml);
let pr = printf
let rep = 1
let extract pre s =
let ls = String.length s in
let lpre = String.length pre in
if (ls >= lpre) && (String.sub s 0 lpre) = pre then
(String.sub s lpre (ls - lpre))
failwith "Invalid string"
let time s =
let s = "/usr/bin/time --format=\"%e,%U\\n\" " ^ s ^ " 2>&1" in
let s = sp "%s -p %s 2>&1" time_cmd s in
flush stdout;
for i = 1 to rep do
let ic = Unix.open_process_in s in
let t = input_line ic in
let real = input_line ic in
let user = input_line ic in
let sys = input_line ic in
ignore (Unix.close_process_in ic);
pr "%s " t;
pr "%s,%s " (extract "real" real) (extract "user" user);
flush stdout;
pr "\n"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment