1
0
Fork 0
mirror of https://git.sr.ht/~cadence/cloudtube synced 2026-03-19 02:41:36 +00:00

11x speed up of subscription page generation

My 30 subscriptions now take 25 ms to generate, instead of around 280.

Around 120 ms were saved by creating a database index.
Around 120 ms were saved by pre-compiling the pug template for video
description timestamps.
The other changes in this commit produced slight improvements.
This commit is contained in:
Cadence Ember 2021-08-26 23:47:53 +12:00
parent 0aa0505009
commit 55065e2a9e
No known key found for this signature in database
GPG key ID: BC1C2C61CF521B17
4 changed files with 15 additions and 9 deletions

View file

@ -58,6 +58,11 @@ const deltas = [
function() {
db.prepare("ALTER TABLE Subscriptions ADD COLUMN channel_missing INTEGER DEFAULT 0")
.run()
},
// 9: add index Videos (authorID)
function() {
db.prepare("CREATE INDEX Videos_authorID ON Videos (authorID)")
.run()
}
]