#include "perftest.h"
#include "rapidjson/schema.h"
#include <ctime>
#include <string>
#include <vector>
Go to the source code of this file.
◆ ARRAY_SIZE
| #define ARRAY_SIZE |
( |
|
a | ) |
sizeof(a) / sizeof(a[0]) |
◆ TEST_F()
Definition at line 191 of file schematest.cpp.
192 char validatorBuffer[65536];
195 const int trialCount = 100000;
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) {
204 (*testItr)->Accept(validator);
207 validatorAllocator.Clear();
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);