3 ms·
I've used both sql.js and WebSQL. Sql.js will get the job done in a lot of cases, but it is not a perfect substitute. Sql.js's performance is an order of a magn
by ken47 12y ago
I've used both sql.js and WebSQL. Sql.js will get the job done in a lot of cases, but it is not a perfect substitute. Sql.js's performance is an order of a magnitude worse than WebSQL when put under heavy load (this likely has more to do with ASM vs true native code than Sql.js in particular). Particularly, sql.js starts to stutter at a far lower query load than WebSQL for a given machine. Furthermore, Sql.js uses sqlite3_exec() under the hood, which means that all results get converted to strings, regardless of the underlying type of the column. And finally, effective memory capacities are not the same.
- jwise0 12y agoYes, I just wrote a small app around sql.js, and I was surprised at how poorly it performed. I was expecting to be within a factor of three of native, but I'm seeing performance down by an order of magnitude or so. The sql.js page alludes to bugs open in Firefox and Chrome for these issues; I imagine they'll shake out over time, but it's certainly not a buttery smooth experience just yet. Even still, it certainly works better than the alternatives!