/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 validate/tools2.h

  • Committer: Suren A. Chilingaryan
  • Date: 2009-09-23 17:13:04 UTC
  • Revision ID: csa@dside.dyndns.org-20090923171304-osvtr4zqb29h11kd
Intel, Tango, Phobos, and RapidXML parsers; Memory benchmark scripts

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
    struct TestData td;
79
79
    char *xmlbuf,*xsdbuf;
80
80
 
 
81
    int parse_xml = 1;
 
82
    int validate_xml = 1;
 
83
    
 
84
    if (getenv("skip_validate")) {
 
85
        validate_xml = 0;
 
86
        if (getenv("skip_xml")) parse_xml = 0;
 
87
    }
 
88
 
81
89
    if (argc!=4) Usage(argv[0]);
82
90
 
83
91
    td.iterations = atol(argv[1]);
84
 
    if (td.iterations<=0) Usage(argv[0]);
 
92
    if (td.iterations<0) Usage(argv[0]);
85
93
    
86
94
    if (!strncmp(argv[2],"xmlgen",6)) mode=1;
87
95
    else if (!strncmp(argv[2],"opcgen",6)) mode=2;
143
151
    
144
152
    initXML(&td);
145
153
 
146
 
    parseXML(&td,0);
 
154
    if (parse_xml) parseXML(&td,0);
147
155
    
148
156
    disp_init();
149
157
    for (i=1;i<=td.iterations;i++) {
156
164
            break;
157
165
        }
158
166
        gettimeofday(&pre_time,NULL);
159
 
        parseXML(&td,i);
 
167
        if (parse_xml) parseXML(&td,i);
160
168
        gettimeofday(&post_time,NULL);
161
169
        time=(post_time.tv_sec-pre_time.tv_sec)*1000000+(post_time.tv_usec-pre_time.tv_usec);
162
170
        disp_event(time);
175
183
    init_time=(post_time.tv_sec-pre_time.tv_sec)*1000000+(post_time.tv_usec-pre_time.tv_usec);
176
184
 
177
185
    gettimeofday(&pre_time,NULL);
178
 
    validateXML(&td,0);
 
186
    if (validate_xml) validateXML(&td,0);
179
187
    gettimeofday(&post_time,NULL);
180
188
    init_time2=(post_time.tv_sec-pre_time.tv_sec)*1000000+(post_time.tv_usec-pre_time.tv_usec);
181
189
 
190
198
            break;
191
199
        }
192
200
        gettimeofday(&pre_time,NULL);
193
 
        validateXML(&td,i);
 
201
        if (validate_xml) validateXML(&td,i);
194
202
        gettimeofday(&post_time,NULL);
195
203
        time=(post_time.tv_sec-pre_time.tv_sec)*1000000+(post_time.tv_usec-pre_time.tv_usec);
196
204
        disp_event(time);