Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
ce339635
Commit
ce339635
authored
Oct 05, 2007
by
Pietro Abate
Browse files
[r2003-06-07 16:55:57 by cvscast] Benchmarks
Original author: cvscast Date: 2003-06-07 16:55:57+00:00
parent
4871dccc
Changes
1
Hide whitespace changes
Inline
Side-by-side
benchmarks/bench.ml
View file @
ce339635
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
=
"split.ml"
let
xml
=
"split"
let
cduce
=
[
"split0.cd"
;
"split1.cd"
;
"split2.cd"
]
...
...
@@ -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
))
else
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
;
done
;
pr
"
\n
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment