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 the use of Math.round() in the SSIM diff generation function #232

Open
omnisip opened this issue Aug 20, 2020 · 1 comment
Open

Comments

@omnisip
Copy link
Contributor

omnisip commented Aug 20, 2020

Part 1 of 2 issues that are big performance improvements for the library.

Recently, I built a new implementation of SSIM and had it incorporated into SSIM.js (weberSsim). During testing and implementation, I found that the use of Math.round and Math.pow (also seen as the operator** in ES6) had horrible performance times. It was so bad that I found that I could increase performance by 66% and, in the test harness 60-80ms per test, by removing the use of Math.round and replacing it with a reusable Int32Array and adding floating point 0.5 (matching the Math.round specification) before saving. In our case, this would greatly improve diff generation performance for SSIM based testing.

As such, I would like to submit a pull request with these changes so this library can benefit too.

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity.

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

No branches or pull requests

1 participant