summaryrefslogtreecommitdiff
path: root/stream.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2021-12-27 23:34:14 +0800
committerxuri <xuri.me@gmail.com>2021-12-27 23:49:28 +0800
commit89b85934f60ba0012f3de6da03eb12959e4b4b72 (patch)
tree3d913c2bdabf06b79b7c2f223cfe26b64aacd8cc /stream.go
parent6b1e592cbc7b1412da5f6d0badeaf1083117c762 (diff)
This closes #1096, memory usage optimization and another 4 changes
- Unzip shared string table to system temporary file when large inner XML, reduce memory usage about 70% - Remove unnecessary exported variable `XMLHeader`, we can using `encoding/xml` package's `xml.Header` instead of it - Using constant instead of inline text for default XML path - Rename exported option field `WorksheetUnzipMemLimit` to `UnzipXMLSizeLimit` - Unit test and documentation updated
Diffstat (limited to 'stream.go')
-rw-r--r--stream.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/stream.go b/stream.go
index 65d6b72..4bd721e 100644
--- a/stream.go
+++ b/stream.go
@@ -112,7 +112,7 @@ func (f *File) NewStreamWriter(sheet string) (*StreamWriter, error) {
}
f.streams[sheetPath] = sw
- _, _ = sw.rawData.WriteString(XMLHeader + `<worksheet` + templateNamespaceIDMap)
+ _, _ = sw.rawData.WriteString(xml.Header + `<worksheet` + templateNamespaceIDMap)
bulkAppendFields(&sw.rawData, sw.worksheet, 2, 5)
return sw, err
}