many changes related to #1192:

- use CSS contain wherever possible to reduce subtrees of forced reflows
- reduced dependency between note and note_contents updates which will reduce number of updates to components
- optimization of "many rows" querying
This commit is contained in:
zadam
2020-08-16 22:57:48 +02:00
parent c20577909c
commit 53b39e2e82
39 changed files with 169 additions and 58 deletions

View File

@@ -93,9 +93,9 @@ function getValue(query, params = []) {
return row[Object.keys(row)[0]];
}
const PARAM_LIMIT = 900; // actual limit is 999
// smaller values can result in better performance due to better usage of statement cache
const PARAM_LIMIT = 100;
// this is to overcome 999 limit of number of query parameters
function getManyRows(query, params) {
let results = [];
@@ -114,7 +114,11 @@ function getManyRows(query, params) {
const questionMarks = curParams.map(() => ":param" + i++).join(",");
const curQuery = query.replace(/\?\?\?/g, questionMarks);
const subResults = dbConnection.prepare(curQuery).all(curParamsObj);
const statement = curParams.length === PARAM_LIMIT
? stmt(curQuery)
: dbConnection.prepare(curQuery);
const subResults = statement.all(curParamsObj);
results = results.concat(subResults);
}