This PR adds adds multi-row insertion support to the KLDatabase.Database.insert method, providing massive speedups when inserting many rows of data at a a time.
Previously, inserting rows one-by-one would commit the changes to the database after every row, which is a slow I/O operation (especially on computers with slower storage). When inserting hundreds of rows at once, it could take over 2 seconds in some cases! With these changes, when providing multiple rows to insert in a list, the database changes are only committed once at the end, increasing performance to ~30ms for the same data that took over 2 seconds during testing.
Merge Checklist
[x] the PR has been reviewed and all comments are resolved
PR Description
This PR adds adds multi-row insertion support to the
KLDatabase.Database.insert
method, providing massive speedups when inserting many rows of data at a a time.Previously, inserting rows one-by-one would commit the changes to the database after every row, which is a slow I/O operation (especially on computers with slower storage). When inserting hundreds of rows at once, it could take over 2 seconds in some cases! With these changes, when providing multiple rows to
insert
in a list, the database changes are only committed once at the end, increasing performance to ~30ms for the same data that took over 2 seconds during testing.Merge Checklist
closes #<issue-number>
to automatically close an issue