You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@anisha-rohra investigated and fixed the original problem reported, now working on additional reported problems and also to investigate if we can remove the C++ 11 requirement.
@NickNaso requested some benchmarks. Here are some rough numbers from the Mocha tests.
Mocha Test
NAN
N-API
should return the correct lastID (insert 5000 rows)
102
111
fuss-free incremental backups work
193
183
retrieve 100,000 rows with Statement#each
270
350
should insert rows with lots of null values
97
81
should insert in parallel
635
805
should prepare a statement and run it 1005 times
47
should have inserted all the rows after synchronizing with serialize()
85
serialize(fn) - should call the callback
129
unicode - should insert all values
107
The NAN and N-API columns show those tests for which Mocha is reporting a "slow" time. The Mocha default "slow" threshold is 75ms. A timer is displayed for those tests exceeding ~37ms.
Both Mocha tests run in about two seconds of wall-clock time.
Below is the results of the benchmarks I've run as we discussed at the most recent weekly meeting.
Two tests were run, one for NAN and one for N-API, both using Node.js v12.16.2. The NAN test was run using a pre-built, downloadable binary for the currently shipping node-sqlite3 v4.2.0. The N-API test was run using a binary locally built from the current node-sqlite3master branch that will eventually ship as node-sqlite3 v5.0.0. Both tests were run on a MacBook Pro (Late 2016).
node-sqlite3 has a Mocha suite that runs 159 tests. For this benchmark, the complete suite was run sequentially 20 times. All 20 iterations were run in the same process. The wall-clock time for the NAN tests was 33 seconds, and the wall-clock time for the N-API tests was 38 seconds. This means the wall-clock time for the N-API version is about 15% greater than the NAN version.
Here's what the table headings mean:
Mocha Test The name of the Mocha test. NAN Mean The mean run time, in ms, of the 20 NAN tests. NAPI Mean The mean run time, in ms, of the 20 N-API tests. Diff The difference between the N-API mean run time and NAN mean run time. % The N-API mean run time expressed as a percentage of the NAN mean run time. NAN s The standard deviation of the NAN mean run time. NAPI s The standard deviation of the N-API mean run time.
Mocha Test
NAN Mean
NAPI Mean
Diff
%
NAN s
NAPI s
query properties should return the correct lastID
93
136
43
146
14
8
query properties should return the correct changes count
1
1
1
153
0
0
backup output db created once step is called
4
6
1
134
3
2
backup copies source fully with step(-1)
4
4
0
102
1
1
backup backup db not created if finished immediately
1
0
0
73
0
0
backup error closing db if backup not finished
0
0
0
63
0
0
backup using the backup after finished is an error
1
1
0
110
1
0
backup remaining/pageCount are available after call to step
1
1
0
100
0
0
backup backup works if database is modified half-way through
6
7
1
112
1
1
backup can backup from temp to main
2
2
0
112
1
0
backup can backup from main to temp
1
1
0
133
0
0
backup cannot backup to a locked db
1
2
0
123
0
1
backup fuss-free incremental backups work
203
204
1
100
6
5
backup setting retryErrors to empty disables automatic finishing
Activity
aruneshchandra commentedon Jan 11, 2018
@anisha-rohra investigated and fixed the original problem reported, now working on additional reported problems and also to investigate if we can remove the C++ 11 requirement.
mhdawson commentedon May 3, 2018
mapbox, found issue, we fixed in our repo.
Anisha is working on PR.
mhdawson commentedon Oct 7, 2019
Jim has been working on this for a while, see TryGhost/node-sqlite3#830 for current state.
jschlight commentedon Apr 18, 2020
There is now a PR under active work. TryGhost/node-sqlite3#1304
jschlight commentedon Apr 20, 2020
@NickNaso requested some benchmarks. Here are some rough numbers from the Mocha tests.
The NAN and N-API columns show those tests for which Mocha is reporting a "slow" time. The Mocha default "slow" threshold is 75ms. A timer is displayed for those tests exceeding ~37ms.
Both Mocha tests run in about two seconds of wall-clock time.
jschlight commentedon Apr 27, 2020
The PR has landed.
jschlight commentedon Apr 30, 2020
Below is the results of the benchmarks I've run as we discussed at the most recent weekly meeting.
Two tests were run, one for NAN and one for N-API, both using Node.js v12.16.2. The NAN test was run using a pre-built, downloadable binary for the currently shipping
node-sqlite3v4.2.0. The N-API test was run using a binary locally built from the currentnode-sqlite3masterbranch that will eventually ship asnode-sqlite3v5.0.0. Both tests were run on a MacBook Pro (Late 2016).node-sqlite3has a Mocha suite that runs 159 tests. For this benchmark, the complete suite was run sequentially 20 times. All 20 iterations were run in the same process. The wall-clock time for the NAN tests was 33 seconds, and the wall-clock time for the N-API tests was 38 seconds. This means the wall-clock time for the N-API version is about 15% greater than the NAN version.Here's what the table headings mean:
Mocha Test The name of the Mocha test.
NAN Mean The mean run time, in ms, of the 20 NAN tests.
NAPI Mean The mean run time, in ms, of the 20 N-API tests.
Diff The difference between the N-API mean run time and NAN mean run time.
% The N-API mean run time expressed as a percentage of the NAN mean run time.
NAN s The standard deviation of the NAN mean run time.
NAPI s The standard deviation of the N-API mean run time.
Mean
Mean
s
s
† This test succeeds on N-API but fails on NAN.
‡ This is an artifact from the Mocha tests.
jschlight commentedon Apr 30, 2020
This is the raw data, in
JSONformat, used to create the table above .rawdata.txt
mhdawson commentedon May 4, 2020
PR has landed in sqlite repo so closing this.
jschlight commentedon Jul 1, 2020
node-sqlite3v5.0.0 with N-API support has been published to npm.https://github.com/mapbox/node-sqlite3/releases/tag/v5.0.0