Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write Performance #1168

Closed
duke-git opened this issue Mar 3, 2022 · 7 comments
Closed

Write Performance #1168

duke-git opened this issue Mar 3, 2022 · 7 comments
Labels
needs more info This issue can't reproduce, need more info

Comments

@duke-git
Copy link

duke-git commented Mar 3, 2022

使用write方法写入gin返回给前端,非常慢,截图是文件大小70M,用了41s. 请问有什么优化方法吗?
// file -> *excelize.File, c -> *gin.Context
_ = file.Write(c.Writer)

@duke-git
Copy link
Author

duke-git commented Mar 3, 2022

image

@xuri
Copy link
Member

xuri commented Mar 3, 2022

Can you show us a complete, standalone example program or reproducible demo? And provide your input file, or at least tell us about it?

@xuri xuri changed the title Write方法优化 Write Performance Mar 3, 2022
@xuri xuri added the needs more info This issue can't reproduce, need more info label Mar 3, 2022
@duke-git
Copy link
Author

duke-git commented Mar 4, 2022

我写一个实际业务的模拟方法,请参考截图:file.Write(c.Writer),70M文件要写入40s左右。
image

@xuri
Copy link
Member

xuri commented Mar 4, 2022

Thanks for your feedback, please using stream writer for generating a new worksheet with huge amounts of data, and also reference the performance benchmark report.

@duke-git
Copy link
Author

duke-git commented Mar 4, 2022

好的,用的是这个库:github.com/360EntSecGroup-Skylar/excelize/v2 v2.3.2, 和 github.com/xuri/excelize/v2 是同一个吗?

@xuri
Copy link
Member

xuri commented Mar 4, 2022

Yep, please using github.com/xuri/excelize/v2, and also reference the issues #973, #1020, and #1079.

@duke-git
Copy link
Author

duke-git commented Mar 4, 2022

谢谢

@xuri xuri closed this as completed May 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info This issue can't reproduce, need more info
Projects
None yet
Development

No branches or pull requests

2 participants