Skip to content

New premium version with web worker support upon customer demand (under consideration) #11

@brody4hire

Description

@brody4hire

I received a couple inquiries for continued web worker support to help solve performance issues in two different cases:

  1. Issue when populating with data from one or more external servers.
  2. Issue when reading and processing binary/base64 image data from the database (ref: BLOB data support (MBTiles etc.) #10)

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 and db.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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions