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