diff options
author | Michael <osiris2918@gmail.com> | 2019-04-16 01:50:16 -0500 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2019-04-16 14:50:16 +0800 |
commit | 0f9170a03b9fe19c1c22687fba8bcbdfd69a6347 (patch) | |
tree | bc7e73c690d274548530199de14c4d668d45c118 /styles.go | |
parent | a88459d5f1e83006ba421f334a1513d1c231eb6b (diff) |
Resolve #382, rewrite prepareSheetXML to scale linearly (#383)
* Rewrite prepareSheetXML to scale linearly
We don't need to backfill columns into every row for most purposes
Provided makeContiguousColumns for setting styles where we do
need it for a specific region.
Added a benchmark to monitor progress. For 50,000 rows this went
from about 11 seconds to 1 second. The improvements are more
dramatic as the row/column count increases.
* Assigning that row value was redundant
Diffstat (limited to 'styles.go')
-rw-r--r-- | styles.go | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -2373,6 +2373,7 @@ func (f *File) SetCellStyle(sheet, hcell, vcell string, styleID int) error { return err } prepareSheetXML(xlsx, vcol, vrow) + makeContiguousColumns(xlsx, hrow, vrow, vcol) for r := hrowIdx; r <= vrowIdx; r++ { for k := hcolIdx; k <= vcolIdx; k++ { |