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

The NewStyle(style *Style) memory replication of too many times #1505

Open
zjfGH opened this issue Mar 22, 2023 · 2 comments
Open

The NewStyle(style *Style) memory replication of too many times #1505

zjfGH opened this issue Mar 22, 2023 · 2 comments

Comments

@zjfGH
Copy link

zjfGH commented Mar 22, 2023

Locality: NewStyle() -> f.getStyleID() -> range ss.CellXfs.Xf

styles.go:2116

code:
for xfID, xf := range ss.CellXfs.Xf { if getXfIDFuncs["numFmt"](numFmtID, xf, style) && getXfIDFuncs["font"](fontID, xf, style) && getXfIDFuncs["fill"](fillID, xf, style) && getXfIDFuncs["border"](borderID, xf, style) && getXfIDFuncs["alignment"](0, xf, style) && getXfIDFuncs["protection"](0, xf, style) { styleID = xfID return styleID, err } }

range and getXfIDFuncs will copy each of the xf elements, consumes a lot of performance。

@xuri
Copy link
Member

xuri commented Mar 23, 2023

Thanks for your issue. How many new styles did you create, how much did memory cost in your case? and what expected you want? Could you follow the issue templates to provide more details about this issue?

@zjfGH
Copy link
Author

zjfGH commented Mar 23, 2023

1.Each file to perform new styles twice, A total of 200 calls.
2.Consumes 2g 10 c when case running.
3. Memory consumption is acceptable, but the cup is too high. Hope can optimize the new styles 's execution time

About this case pprof sample:
pprof imgs.docx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants