Closed ulshv closed 7 years ago
It's an issue if we can fix it. :-) I don't know, so it's helpful to have reports such as yours, though can you also give an apples-to-apples comparison benchmark where possible (e.g., desktop WebSQL vs. desktop native IDB?)
From my testing on Chrome or Safari, I think it might be closer to 3-to-1 (though with Safari choking when there are too many queries at once).
It'd be helpful to do some JavaScript profiling to see whether we have any particularly sluggish routines. I'm not in a position to focus on that now, but we'd of course welcome input or PRs that could help.
It's not big issue anyway. I'll try to make some profiling in the future if it will become critical. Just made some apples-to-apples comparsions for you :) Here they are:
Desktop Chrome: IDB: 1.2 sec, WebSQL: 5.7 sec. Safari (iOS 5-8): IDB: not available, WebSQL: 42 sec (average). Safari on iPhone 7 (iOS 10.3): IDB: 0.9 sec, WebSQL: 4.5 sec. Chrome on Android 6 (Nexus 6): IDB: 2.2 sec, WebSQL: 35 sec. Chrome on Android 7.1 (Google Pixel XL): IDB 1.8 sec, WebSQL: 20 sec.
Very helpful, thanks... With the difference on desktop between IDB and WebSQL not being too dramatic, I'm not as worried about there being some fundamental performance problems. There are not only the hoops of non-native performance but also the fact that by necessity we have to scaffold extra code on top of WebSQL.
Per the interesting site http://reyesr.github.io/html5-storage-benchmark/ , in my running its tests on Chrome (Mac), WebSQL is about 1/3 slower too (for inserts as well as everything besides clearing data where it is faster than IDB).
Since I don't know that there is anything we can do about this, do you think we should keep the issue open?
Since I'm not sure what can be done here, I think I'll close, but if you identify any particular bottlenecks that we could address, I can reopen...
I just tested IDBShim performance and found that instertions in WebSQL DB is 20-40 times slower than in IDB (Android/Desktop). Is it issue or it's okay? Here is test example: https://jsfiddle.net/xf2zrL4p/110/ For 10,000 items I get: (in average)