pouchdb/pouchdb — pull request #2899 by nolanlawson (2014-10-19 16:23:43+00:00)
Title: (#2890) - WIP- incremental hex parse calculation

@calvinmetcalf I think your expertise would be very useful here.

Background: we need to pull hex binaries out of WebSQL using the SQLite `HEX()` function because WebSQL has a fun bug. For the record, I recently filed the bug on [Chromium](https://code.google.com/p/chromium/issues/detail?id=422690) and (Safari)[https://bugs.webkit.org/show_bug.cgi?id=137637].

This is what's causing the DOM to freeze. The proof is in [this bl.ocks.org](http://bl.ocks.org/nolanlawson/raw/73f15f3fe612b8770e79/). You can run the Chrome profiler and see that `parseHexString()` is blocking.

I've coded up this fix, which blocks the DOM a lot less, but apparently the function is still blocking quite a bit according to the Chrome profiler. And the GIFs are still jerky. @calvinmetcalf I'm not sure what else I could be doing; I even did [a jsperf](http://jsperf.com/parse-hex) to verify my hex parser. Any ideas?