Merge pull request #825 from simdjson/jkeiser/documents-sec

Don't include benchmark overhead in documents/s
This commit is contained in:
John Keiser
2020-04-28 15:19:18 -07:00
committed by GitHub
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -252,7 +252,7 @@ struct benchmarker {
// Statistics about the JSON file independent of its speed (amount of utf-8, structurals, etc.).
// Loaded on first parse.
json_stats* stats;
// Speed and event summary for full parse (not including allocation)
// Speed and event summary for full parse (including allocation, stage 1 and stage 2)
event_aggregate all_stages{};
// Speed and event summary for stage 1
event_aggregate stage1{};
@@ -431,7 +431,7 @@ struct benchmarker {
return 100.0 * a / b;
}
void print(bool tabbed_output, size_t iterations) const {
void print(bool tabbed_output) const {
if (tabbed_output) {
char* filename_copy = (char*)malloc(strlen(filename)+1);
strcpy(filename_copy, filename);
@@ -509,7 +509,7 @@ struct benchmarker {
freqmin, freqmax, freqall);
}
}
printf("\n%.1f documents parsed per second\n", static_cast<double>(iterations)/static_cast<double>(loop.best.elapsed_sec()));
printf("\n%.1f documents parsed per second (best)\n", 1.0/static_cast<double>(all_stages.best.elapsed_sec()));
}
}
};
+1 -1
View File
@@ -202,7 +202,7 @@ int main(int argc, char *argv[]) {
if (!options.verbose) { progress.erase(); }
for (size_t i=0; i<options.files.size(); i++) {
benchmarkers[i]->print(options.tabbed_output, options.iterations);
benchmarkers[i]->print(options.tabbed_output);
delete benchmarkers[i];
}