Closed stefvw93 closed 6 years ago
No idea why I can't get the code insertion done properly, though...
Hey there :) Sorry for taking so long on this.
Firstly, code insertion on GitHub takes place between three backticks (```
).
Secondly, neat! I don't doubt that some of the algorithms are slow (some of them are quite old and could probably be updated).
I don't have a lot of time to look into this at this very moment, but if you want to take a whack at a PR for replacing the existing algorithm (and making sure the existing tests still pass) then that'd be very much appreciated :)
Thank you for the issue and for the implementation!
@stefvw93 you could use my package, see https://repl.it/@caub/rgbToHsv-bench
Published as 1.9.2
. Thanks again @stefvw93 :)
Hey Qix!
I have used your rgb to hsv algorithm for a while, until I tried writing my own algorithm. I did a performance test on a high-res image (6000 x 4000 pixels). My algorithm was 12 times (!!!) faster than your algorithm. I haven't looked into your code to see what we do differently, but I took the time to give you my solution.
Context: I used your algorithm to do a pixel-by-pixel conversion from rgb to hsv, to calculate the difference in hue. So practically I'm iterating 24 000 000 times. Using your algorithm, the entire loop took about 12 seconds on chrome on an early 2015 macbook pro. My solution ended up taking a bit over 1 second to complete.
So yea here it is:
Edit: context