/xmlbench/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/xmlbench/trunk

« back to all changes in this revision

Viewing changes to parse/lisp/xmls.cl

  • Committer: Suren A. Chilingaryan
  • Date: 2009-09-28 21:25:28 UTC
  • Revision ID: csa@dside.dyndns.org-20090928212528-e6oby5he4yrueskz
Parsing tests for mono, vtd-xml, lisp, scripting languages

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/clisp -C  --quiet --quiet
 
2
 
 
3
(load "/usr/share/common-lisp/source/xmls/xmls.lisp")
 
4
 
 
5
(defvar dom NIL)
 
6
 
 
7
(defun parse_file (fn)
 
8
    (setf dom
 
9
        (with-open-file 
 
10
            (xml fn) 
 
11
            (xmls::parse xml))))
 
12
 
 
13
(defun parse_iteration (fn i)
 
14
    (if fn
 
15
        (parse_file fn)
 
16
        (parse_file (concatenate 'string "../xml.tmp/" (write-to-string i) ".xml"))))
 
17
 
 
18
(defvar iterations NIL)
 
19
(defvar xmlfn NIL)
 
20
 
 
21
(if (> (length *ARGS*) 0)
 
22
    (setf iterations (parse-integer (first *ARGS*)))
 
23
    (setf iterations 0))
 
24
 
 
25
(if (> (length *ARGS*) 1)
 
26
    (setf xmlfn (second *ARGS*))
 
27
    (setf xmlfn NIL))
 
28
 
 
29
;(compile-file "xmls.cl" :warnings 0)
 
30
 
 
31
(parse_iteration xmlfn 0)
 
32
;(pprint (list "Number of Iterations" iterations))
 
33
(if (> iterations 0)
 
34
    (time
 
35
        (dotimes (i iterations) 
 
36
            (parse_iteration xmlfn (+ i 1))))
 
37
    (dotimes (i iterations) 
 
38
        (parse_iteration xmlfn (+ i 1))))
 
39
 
 
40
 
 
41
;(pprint dom)
 
42