This closes #2355, improve chart and style XML element compatibility to prevent generate corrupted workbook - #2343
Conversation
|
Thanks for your PR. Any benchmark data on the performance impact of the changes? Specifically, how much memory is saved, and any speed impact? I suggest test with excelize-benchmark for performance related changes. |
|
The following benchmark report compares memory usage before and after the changes in this PR. The benchmarks were conducted by generating a workbook generated by xuri/excelize-benchmark containing 512K cells. Environment: Workbook generated using the following command: ./v2.11.0-master -func=StreamWriter -rows=102400 -cols=50 -n=6Base version This PR: #2343 |
… for writeToZip function
xuri
left a comment
There was a problem hiding this comment.
According the benchmark, there are no significant memory reduced, so I not suggest accept this changes. I've made some changes based on your branch to fix another issue instead of close this directly.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2343 +/- ##
=======================================
Coverage 99.62% 99.62%
=======================================
Files 32 32
Lines 26979 26979
=======================================
Hits 26877 26877
Misses 53 53
Partials 49 49
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Related Issue
#2342
Description
This change updates the save path for temp-file-backed workbook parts.
Currently, when
writeToZipwrites entries fromf.tempFiles, it callsf.readBytes(path). If the entry is backed by a temp file,readBytesopens the temp file, reads the entire content into memory withio.ReadAll, stores it back intof.Pkg, and then writes the resulting byte slice to the ZIP writer.This change avoids materializing the whole temp file in heap. Instead,
writeToZipopens the temp file withf.readTemp(path)and streams it directly to the ZIP writer withio.Copy.The saved workbook content is intended to be functionally equivalent: