Miguel Coelho
Miguel Coelho

Reputation: 93

Better-sqlite3 performance issues with Electron

This is more a question than a proper issue.

I have implemented the better-sqilite3 npm in an electron app. I have an Android app that uses the Cordova sqlite plugin and I am testing the time running the queries and realize that the better-sqlite3 is 10x slower than the Cordova sqlite plugin.

Is this normal or is something in the code that I need to increase performance?

The app is the same that runs on Android and Electron and the commands are the same.

Upvotes: 0

Views: 66

Answers (1)

Miguel Coelho
Miguel Coelho

Reputation: 93

The way that I solved my problem was by changing the journal_mode to 'WAL' instead of using the default one because I was using many batch inserts.

More details in this GitHub issue: https://github.com/WiseLibs/better-sqlite3/issues/1323#issuecomment-2616665140

Upvotes: 0

Related Questions