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

Remove custom number formatting in ICC #403

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

drewnoakes
Copy link
Owner

Analysing some CPU traces showed ~0.5% of sampled CPU stacks were hitting this number formatting function. The code itself looks pretty wild and I'm very happy to be removing it. Half a percent may not seem high, but this is one of the highest CPU consuming methods of the library in the trace, which is definitely not expected.

Looks like it was ported over from Java: https://github.com/drewnoakes/metadata-extractor/blob/b19ac0637ff1481bed8029130a9e8669267b4980/Source/com/drew/metadata/icc/IccDescriptor.java#L227-L246. A similar fix would be good there.

Analysing some CPU traces showed ~0.5% of sampled CPU stacks were hitting this number formatting function. The code itself looks pretty wild and I'm very happy to be removing it. Half a percent may not seem high, but this is one of the highest CPU consuming methods of the library in the trace, which is definitely not expected.

Looks like it was ported over from Java: https://github.com/drewnoakes/metadata-extractor/blob/b19ac0637ff1481bed8029130a9e8669267b4980/Source/com/drew/metadata/icc/IccDescriptor.java#L227-L246. A similar fix would be good there.
@drewnoakes
Copy link
Owner Author

image

@drewnoakes drewnoakes merged commit 5482e10 into main Feb 7, 2024
2 checks passed
@drewnoakes drewnoakes deleted the remove-custom-number-formatting branch February 7, 2024 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant