image-js / image-js-typescript

Temporary repository to work on the migration of image-js to TypeScript
https://image-js.github.io/image-js-typescript/
MIT License
5 stars 5 forks source link

chore: improve alignMinDifference #389

Closed lpatiny closed 1 year ago

lpatiny commented 1 year ago

Improve the speed of alignMinDifference.

Original code: 1700 ms Avoiding the creation of images: 1200 ms Changing Math.abs to if / else : 200 ms

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (afecc5f) 98.64% compared to head (31bd0a9) 98.64%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #389 +/- ## ======================================= Coverage 98.64% 98.64% ======================================= Files 224 224 Lines 5817 5830 +13 Branches 1226 1232 +6 ======================================= + Hits 5738 5751 +13 Misses 76 76 Partials 3 3 ``` | [Files Changed](https://app.codecov.io/gh/image-js/image-js-typescript/pull/389?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=image-js) | Coverage Δ | | |---|---|---| | [src/align/alignMinDifference.ts](https://app.codecov.io/gh/image-js/image-js-typescript/pull/389?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=image-js#diff-c3JjL2FsaWduL2FsaWduTWluRGlmZmVyZW5jZS50cw==) | `100.00% <100.00%> (ø)` | | | [src/compare/subtract.ts](https://app.codecov.io/gh/image-js/image-js-typescript/pull/389?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=image-js#diff-c3JjL2NvbXBhcmUvc3VidHJhY3QudHM=) | `100.00% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.

:loudspeaker: Have feedback on the report? Share it here.