-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New premium version with web worker support upon customer demand (under consideration) #11
Comments
@brodybits Thanks for taking a look at this. Part of the performance issue when reading In the example above, the rest of the thread lock is caused by inflating the binary payload, which is trivial to do in a worker. Offering |
Thanks @kristfal for the feedback and performance timeline. It does help make the case for web worker support. On the technical side: I think the only way to achieve the desired functionality for @kristfal on Android (case 2) is to use a custom URI handler that handles the request and returns the result, maybe synchronously. I suspect it would be a blocking call on the worker but would have to do some experimentation to confirm. I would also have to do some experimentation to confirm whether or not it would be possible to achieve the same functionality on iOS. (It should be no problem to match this functionality on Windows.) The other consequence of this scenario is that it could not be integrated with browser platform support (storesafe/cordova-sqlite-storage#576). I hope it will be possible to support both case 1 (populate with data from external servers) and case 2, assuming it will work across the supported platforms Android, iOS, Windows, and possibly macOS. Any comments from @screendriver? |
Also the idea to write data from a worker and listen for success/failure results in the main thread could be tricky on the Windows platform. I would have to do some testing to see if this would work or not. |
Yet another issue with using |
To clarify: in case someone orders a new evplus version with web worker support I would like to completely remove the standard |
You recommend that database.executeSql (for SELECT and single-statement changes) and database.sqlBatch (for multi-statement changes) instead of database.transaction.I try it.But i can't it.Because i dont know how to handle transaction using database.sqlBatch without using db.transaction.Please,show me the way expecially code sample. |
I received a couple inquiries for continued web worker support to help solve performance issues in two different cases:
There is an existing version at https://github.com/litehelpers/Cordova-sqlite-evplus-legacy-workers-free but it has the following major problems:
The ideal solution would be to redesign the apps to move all processing and possibly XHR (HTTP requests) to web workers and reserve the main thread to handle DOM, coordination, and I/O tasks. (Note that this plugin already uses background threads to handle sqlite operations, with the exception of Windows which can easily be fixed.) Unfortunately this may not be a 100% solution since this plugin does have some internal pre/post processing in JavaScript.
The most general solution would be to offer the
db.executeSql
anddb.sqlBatch
functions within web workers. This solution would continue to have the extra communication overhead described above.An alternative solution for case 1 would be to write the data from a worker and let the main thread listen for indications of data write success/failure results. This idea is inspired by existing ideas such as reactive programming and Flow Based Programming (FBP) as described by J. Paul Morrison.
For case 2 an alternative, recommended solution is to read the image data from the main thread and then send it to a web worker for further processing.
The text was updated successfully, but these errors were encountered: