Search speedup by: caching splitted questions/answers, and refactoring string compare algorithym

This commit is contained in:
mrfry 2021-03-17 12:24:50 +01:00
parent 043e825302
commit 8fdc62349b
6 changed files with 152 additions and 86 deletions

View file

@ -33,6 +33,7 @@ import {
processIncomingRequest,
logResult,
backupData,
writeData,
shouldSaveDataFile,
shouldSearchDataFile,
loadJSON,
@ -1364,6 +1365,7 @@ function GetApp(): ModuleType {
function deleteComment(obj, path) {
if (path.length === 1) {
// TODO: check if its actually deleteable by user (deleting other users comments)
obj.splice(path[0], 1)
} else {
const i = path.pop()
@ -1888,7 +1890,7 @@ function GetApp(): ModuleType {
}
if (saveDb) {
utils.WriteFile(JSON.stringify(currDb.data), currDb.path)
writeData(currDb.data, currDb.path)
msgAllWorker({
qdbs: questionDbs,
type: 'update',