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

Avoid creating new strings when parsing PcData #541

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

3bdNKocY
Copy link
Contributor

@3bdNKocY 3bdNKocY commented Mar 7, 2024

Avoid string concat and substring operations to optimize memory usage.
This reduces memory usages by around 80MB on a local large html file.

image

Avoid string concat and substring operations to optimize memory usage.
@JonathanMagnan JonathanMagnan self-assigned this Mar 27, 2024
@JonathanMagnan
Copy link
Member

Hello @3bdNKocY ,

Thank you for your pull. we will make a slight change to it, but besides it, everything looks great.

Best Regards,

Jon

@JonathanMagnan JonathanMagnan merged commit d1574ef into zzzprojects:master Mar 27, 2024
@JonathanMagnan
Copy link
Member

Here is the small improvement we made with your modification: 43d5133

There is no point in starting the string.Compare logic if the tagStartMatching already return false.

I'm not sure how much it will improve the performance but it should certainly doesn't hurt it ;)

Best Regards,

Jon

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

Successfully merging this pull request may close these issues.

2 participants