Closed RoloEdits closed 9 months ago
Pre-allocating removes a lot of regrows for the buffers.
Quick benchmark opening a 150k row, 17 column .xlsx file shows 15% increase in performance.
.xlsx
master:
master
868,545,530 ns/iter (+/- 7,365,438)
perf/pre_alloc_buf:
perf/pre_alloc_buf
750,808,050 ns/iter (+/- 6,366,129)
Purple highlight is alloc.
alloc
Current master:
Change:
Changed from vec![] macro to with_capacity() as there was an introduction to a lot of instructions running.
vec![]
with_capacity()
vec![0;N]:
vec![0;N]
with_capacity(N):
with_capacity(N)
Marginal improvement but still an improvement:
pre 2881d13:
2881d13
post:
Awesome, thanks!
Pre-allocating removes a lot of regrows for the buffers.
Benchmarks
Quick benchmark opening a 150k row, 17 column
.xlsx
file shows 15% increase in performance.master
:perf/pre_alloc_buf
:Profiles
Purple highlight is
alloc
.Current
master
:Change:
Changed from
vec![]
macro towith_capacity()
as there was an introduction to a lot of instructions running.vec![0;N]
:with_capacity(N)
: