This repository was archived by the owner on Jan 1, 2023. It is now read-only.
2x Performance Improvement #54
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I achieved a ~2x performance improvement by removing the UIColor overhead. We now encode a color within a single double. For example, a color with RGB
(255,17,112)would be represented as25517112. We then parse out the individual components with modular arithmetic and compute our color functions on these components.Other changes:
UIImageColorsQualityenum instead of asking user to provide scale down sizeAs this is a big change to the library, I am incrementing the version to
2.0.0. I have tested this version on my own projects and it works well. However, due to how experimental this is, I won't be merging this PR until enough people test it.You can test this on the branch performance-improvement. If you test this and it works well, please give a thumbs up else provide feedback.
Thanks ✌️