mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-12 11:08:10 +08:00
8f17b42074
Summary: Better-SQLite3 is a fork of node-sqlite3 which includes a re-written JavaScript interface. It’s more synchronous, but better reflects what is actually sync vs. async in sqlite’s C++ API. (Not much is really async under the hood.) This diff uses a branch of better-sqlite3 I’ve edited to support Node 6. In my tests, this branch spends 3.24x less time executing queries than `master`. (Measured time spent in calls to `this._db[run|all|get]` over the first 5000 queries of initial sync. It also increased the performance of starring a thread in the thread list by 28%. This library also allows us to use a prepared statement cache, which is great because we often make the same queries repeatedly as query subscriptions refresh the UI and deltas are dumped into the app. The old interface didn’t expose statements (cached query plans) to JS. better-sqlite3 advertises that it uses the JS garbage collector instead of lower level C++ memory management. I tested syncing my entire mailbox to verify that memory usage is not significantly different on this branch after a lot of queries have been made. Finally, it looks like we can finally stop building sqlite3 from scratch in `script/bootstrap`. This library builds properly with `apm install`. 🎉 We might want to change the DatabaseStore and DatabaseTransaction classes more, now that it’s possible to execute queries synchronously. It could make things cleaner and get us out of promise-hell in a few places. In this diff I tried to change as little as possible. Test Plan: Run tests, everything still works Reviewers: juan, jackie Reviewed By: juan, jackie Differential Revision: https://phab.nylas.com/D3315 |
||
---|---|---|
.. | ||
utils | ||
bootstrap | ||
bootstrap.cmd | ||
build | ||
build.cmd | ||
cibuild | ||
cibuild-docker-ubuntu32 | ||
cibuild.ps1 | ||
clean | ||
clean.cmd | ||
docs | ||
grunt | ||
grunt.cmd | ||
mkdeb | ||
mkrpm | ||
rpmbuild | ||
set-version | ||
test |