From 891e5baac1a6ac67123fbc6a68f801720882b8ec Mon Sep 17 00:00:00 2001 From: xuri Date: Tue, 11 Jan 2022 00:24:24 +0800 Subject: ref #1096, reduce memory usage by about 50% for large data spreadsheet --- excelize.go | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) (limited to 'excelize.go') diff --git a/excelize.go b/excelize.go index 26bb340..6100ac4 100644 --- a/excelize.go +++ b/excelize.go @@ -32,30 +32,31 @@ import ( // File define a populated spreadsheet file struct. type File struct { sync.Mutex - options *Options - xmlAttr map[string][]xml.Attr - checked map[string]bool - sheetMap map[string]string - streams map[string]*StreamWriter - tempFiles sync.Map - CalcChain *xlsxCalcChain - Comments map[string]*xlsxComments - ContentTypes *xlsxTypes - Drawings sync.Map - Path string - SharedStrings *xlsxSST - sharedStringsMap map[string]int - sharedStringItemMap *sync.Map - Sheet sync.Map - SheetCount int - Styles *xlsxStyleSheet - Theme *xlsxTheme - DecodeVMLDrawing map[string]*decodeVmlDrawing - VMLDrawing map[string]*vmlDrawing - WorkBook *xlsxWorkbook - Relationships sync.Map - Pkg sync.Map - CharsetReader charsetTranscoderFn + options *Options + xmlAttr map[string][]xml.Attr + checked map[string]bool + sheetMap map[string]string + streams map[string]*StreamWriter + tempFiles sync.Map + CalcChain *xlsxCalcChain + Comments map[string]*xlsxComments + ContentTypes *xlsxTypes + Drawings sync.Map + Path string + SharedStrings *xlsxSST + sharedStringsMap map[string]int + sharedStringItem [][]uint + sharedStringTemp *os.File + Sheet sync.Map + SheetCount int + Styles *xlsxStyleSheet + Theme *xlsxTheme + DecodeVMLDrawing map[string]*decodeVmlDrawing + VMLDrawing map[string]*vmlDrawing + WorkBook *xlsxWorkbook + Relationships sync.Map + Pkg sync.Map + CharsetReader charsetTranscoderFn } type charsetTranscoderFn func(charset string, input io.Reader) (rdr io.Reader, err error) -- cgit v1.2.1