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

Increase the performance of some xml and html helpers #1476

Merged
merged 2 commits into from
Sep 29, 2020

Conversation

alubbe
Copy link
Member

@alubbe alubbe commented Sep 28, 2020

Summary

We saw some performance issues in #742 that this PR tries to solve

Test plan

Both helpers are already tested, this just refactors their implementation.

@alubbe alubbe mentioned this pull request Sep 28, 2020
Copy link
Member

@Siemienik Siemienik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR, nice done
How big speedup you note after these changes?

lib/utils/under-dash.js Outdated Show resolved Hide resolved
@rogozind
Copy link

This is good. Regexp way of finding whether or not we need the escaping is even faster than the loop I suggested #742 .
In my test I got 25% increase in performance. I have 43K rows of data. It takes 20 secs to export. 50% used to go to create the spreadsheet and 50% used to go to write out the files. Out of these 10 secs 5 secs went to serialize various elements and 5 secs went to xmlEncode() calls. With the patch the xmlEncode dropped to near zero so export now takes 15secs.

Please accept this PR.

@alubbe alubbe merged commit 85c680a into exceljs:master Sep 29, 2020
@alubbe alubbe deleted the performance branch September 29, 2020 07:27
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

Successfully merging this pull request may close these issues.

3 participants