/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/cxml-dom.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 -q -q
 
2
; Should be called from root account once to generate binaries for libraries
 
3
 
 
4
(load #p"/usr/share/common-lisp/source/asdf/asdf.lisp")
 
5
(push #p"/usr/share/common-lisp/systems/" asdf:*central-registry*)
 
6
;(asdf:oos 'asdf:load-op :closures-common)
 
7
(asdf:oos 'asdf:load-op :cxml)
 
8
 
 
9
(defvar dom NIL)
 
10
 
 
11
(defun parse_file (fn)
 
12
    (setf dom
 
13
        (cxml:parse-file fn (cxml-dom:make-dom-builder))))
 
14
 
 
15
(defun parse_iteration (fn i)
 
16
    (if fn
 
17
        (parse_file fn)
 
18
        (parse_file (concatenate 'string "../xml.tmp/" (write-to-string i) ".xml"))))
 
19
 
 
20
 
 
21
(defvar iterations NIL)
 
22
(defvar xmlfn NIL)
 
23
 
 
24
(if (> (length *ARGS*) 0)
 
25
    (setf iterations (parse-integer (first *ARGS*)))
 
26
    (setf iterations 0))
 
27
 
 
28
(if (> (length *ARGS*) 1)
 
29
    (setf xmlfn (second *ARGS*))
 
30
    (setf xmlfn NIL))
 
31
 
 
32
(parse_iteration xmlfn 0)
 
33
;(pprint (list "Number of Iterations" iterations))
 
34
(if (> iterations 0)
 
35
    (time
 
36
        (dotimes (i iterations) 
 
37
            (parse_iteration xmlfn (+ i 1))))
 
38
    (dotimes (i iterations) 
 
39
        (parse_iteration xmlfn (+ i 1))))
 
40
 
 
41
 
 
42
;(pprint dom)