webpack - Electron.remote.require('sqlite3') query performance 5x slower, callback 500x slower -


i'm using electron w/ webpack , try add sqlite3 mix. see stripped down test project

i came accross 2 possible solutions.

  1. when require('sqlite3') in index.html , create global variable referencing database, can query db within application using global variable. performance ok.

    issues: using global variable feels ugly , cannot seem configure karma use scenario.

    question: how should configure karma (tried both files , customcontextfile options) unit-test scenario?

  2. when use remote.require('sqlite3') in application, database can opened/created, performance of queries degrade factor ~10 , performance of results callback down ~500x. (i guess it's memory allocation issue)

    issues: sqlite useless performancewise.

    question: why performance degradation occur , how solve use benefits of sqlite?

btw. when using import { database } 'sqlite' const db = new database() node-gyp , node-pre-gyp throw issues haven't been able solve.

nb. have been using sql.js (performance issues) , lovefield (inflexible indexeddb store) alternatives sqlite3.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -