Open TikiTDO opened 8 years ago
When they were written asm.js were not there. I would love to see some prototype, sounds promising.
It seems like there's a potential significant performance gain if we decide to move some of the tracking functions to C. I wouldn't be surprised if trackColor_ worked at least several faster once ported (I've been playing with it a bit, but my C's a bit rusty, so it'll take some time till I have anything worth talking about (ran on quad core i7 3.2 ghz / 16gb ram). Anyway, this would be my first candidate. Also, good job on optimising this stuff using plain JS, really impressive.
hey @paprikka , great to know!
Do you have any branch in a fork of yours that we could take a look and eventually help you with that?
Taking trackColor
as the first candidate (i suppose it's the most straightforward to implement) looks like a great way of validating that
You may fin useful https://github.com/nodeca/multimath to create universal and small math modules in WA/JS.
I noticed a few of the most performance intensive utility functions (all the Image utility functions, and possibly the Fast/Brief implementations) are written in plain Javascript, when all they really do is work with scalars and big buffers. These would be great candidates to be rewritten into something that compiles into asm.js.
Is there a particular reason why this shouldn't be done? If not I could throw together some proof of concepts.