1) Ensure I only save relevant sheets/cells from the files (to speed up
retrieval/parsing)
2) Override parsing in XSSFWorkbook to avoid unnecessary work such as
themes, styles etc
3) Pool the workbooks to avoid creating them every time (even though I need
to be able to update them separately for every request)
4) Something else :-)

I don't know about #1. Personally, I just save the output values, not the
sheets.

#2 seems like a whole lot of work, especially compared to #3.

#3 is what I do: Load the workbook on first request and re-use for
subsequent requests. If you know in advance what cells may be changed, you
can cache those values when you first load a workbook. Then you hand the
workbook out to a consumer, with the understanding that only those input
values are changed. When done you restore the inputs to their
original values. (And, in my case, I re-evaluate the workbook at that
point, to restore things as much as possible.)

#4? Well, profiling is good. A lot of times you think your bottleneck is
one thing and it turns out to be something unexpected entirely.

===Blake===
​

Reply via email to