avinassh / gg-flip

Highly performant Javascript library to flip the signs
https://avi.im/gg-flip/
MIT License
190 stars 5 forks source link

GPU support #4

Open RodrigoHahn opened 6 years ago

RodrigoHahn commented 6 years ago

First of all, thanks Avinash for sharing this project: the purpose is clear, the code is readable, plus it defers to JS (which is objectively the best programming language) - an all around win for everyone. However, I couldn't help but notice it might be lacking in the matter of optimization.

If you allow the metaphor, as much as V8 makes our regular, run-of-the-mill grazing-horse-of-a-code run as if it were on a whisky-and-crack-infused-wheat diet, I feel like we might be missing out on exploiting the next step in advanced sign-flipping tech.

I believe the generated code could be further optimized by mapping the sign-flipping operation into a texture transformation in GPU space. Have you toyed with this idea, and if so, what did you find out?

Once again, thank you for this awesome piece of tech.