Open folsze opened 2 weeks ago
I am now comparing the performance with a Dexie.js sample app and with Dexie.js there are no "long tasks" happening, with the same 20x CPU slowdown:
I used this example angular repo from here:
To make the comparison fair, I made both sample apps create a single simple new entity. The performance difference is very large imo. But I am new to web browser performance so please let me know if my experiment is flawed or anything
As you can see in the dexie.js image, the database operations in Dexie.js usually run 10x slower (roughly at 25ms, sometimes even less) than with capacitor-sqlite (even though both plugins use indexedDB afaik, but only capacitor-sqlite uses sql-wasm).
On the web, when inspecting with slowdown CPU power, this plugin yields lots of long tasks, mainly due to sql-wasm usage.
The CPU power I set to 20x slowdown in google chrome performance tab.
Check the profiler image, all the red tasks are slow and all of them mainly due to sql-wasm:
All you need for reproducing this is cloning this repo:
https://github.com/jepiqueau/blog-tutorials-apps.git
Then run this project which I used in the above screenshot: and adding a new entity with the plus:
https://github.com/jepiqueau/blog-tutorials-apps/tree/main/SQLite/Part-1/ionic7-angular-sqlite-app
So my questions:
Thanks for any info you can provide :)