mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
benchmarks. Styles benchmarks updated with logs. Performance improved.
This commit is contained in:
parent
1c50b35940
commit
f918c6cfaf
|
@ -145,20 +145,20 @@ xlnt::workbook non_optimized_workbook(int n)
|
||||||
|
|
||||||
auto elapsed = current_time() - start;
|
auto elapsed = current_time() - start;
|
||||||
|
|
||||||
std::cout << "took " << elapsed / 1000.0 << "s for " << n << " generate_all_styles" << std::endl;
|
std::cout << "took " << elapsed / 1000.0 << "s for " << n << " rows. generate_all_styles" << std::endl;
|
||||||
|
|
||||||
start = current_time();
|
start = current_time();
|
||||||
for(int idx = 1; idx < n; idx++)
|
for(int idx = 1; idx < n; idx++)
|
||||||
{
|
{
|
||||||
auto worksheet = wb[random_index(wb.sheet_count())];
|
auto worksheet = wb[random_index(wb.sheet_count())];
|
||||||
auto cell = worksheet.cell(xlnt::cell_reference(1, (xlnt::row_t)idx));
|
auto cell = worksheet.cell(xlnt::cell_reference(1, (xlnt::row_t)idx));
|
||||||
cell.value(0);
|
cell.value(idx);
|
||||||
cell.style(styles.at(random_index(styles.size())));
|
cell.style(styles.at(random_index(styles.size())));
|
||||||
}
|
}
|
||||||
|
|
||||||
elapsed = current_time() - start;
|
elapsed = current_time() - start;
|
||||||
|
|
||||||
std::cout << "took " << elapsed / 1000.0 << "s for " << n << " set values and styles for cells" << std::endl;
|
std::cout << "took " << elapsed / 1000.0 << "s for " << n << " rows. set values and styles for cells" << std::endl;
|
||||||
|
|
||||||
return wb;
|
return wb;
|
||||||
}
|
}
|
||||||
|
@ -171,7 +171,7 @@ void to_profile(xlnt::workbook &wb, const std::string &f, int n)
|
||||||
wb.save(f);
|
wb.save(f);
|
||||||
auto elapsed = current_time() - start;
|
auto elapsed = current_time() - start;
|
||||||
|
|
||||||
std::cout << "took " << elapsed / 1000.0 << "s for " << n << " save workbook with styles" << std::endl;
|
std::cout << "took " << elapsed / 1000.0 << "s for " << n << " rows. save workbook with styles" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
Loading…
Reference in New Issue
Block a user