191 {
192 char validatorBuffer[65536];
194
195 const int trialCount = 100000;
196 int testCount = 0;
197 clock_t start = clock();
198 for (int i = 0; i < trialCount; i++) {
199 for (TestSuiteList::const_iterator itr = testSuites.begin(); itr != testSuites.end(); ++itr) {
200 const TestSuite& ts = **itr;
202 for (DocumentList::const_iterator testItr = ts.tests.begin(); testItr != ts.tests.end(); ++testItr) {
203 validator.Reset();
204 (*testItr)->Accept(validator);
205 testCount++;
206 }
207 validatorAllocator.Clear();
208 }
209 }
210 clock_t end = clock();
211 double duration = double(end - start) / CLOCKS_PER_SEC;
212 printf("%d trials in %f s -> %f trials per sec\n", trialCount, duration, trialCount / duration);
213 printf("%d tests per trial\n", testCount / trialCount);
214}
Default memory allocator used by the parser and DOM.