Open
Conversation
Contributor
|
I was once playing around with the sqlite pragmas to see if those could offer faster startup speed. I tried other options as well, but most notable on my system (Mac M1) was adding this There are some caveats to this, so it might not be suitable as a default. diff --git a/src/cache.cpp b/src/cache.cpp
index 4ea1bfa51..e730165cb 100644
--- a/src/cache.cpp
+++ b/src/cache.cpp
@@ -296,6 +296,9 @@ void Cache::set_pragmas()
// then we disable case-sensitive matching for the LIKE operator in
// SQLite, for search operations
run_sql("PRAGMA case_sensitive_like=OFF;");
+
+ // use mmap with 0.5 GB limit
+ run_sql("PRAGMA mmap_size=536870912;");
} |
Contributor
Author
|
Yes, I've also looked into the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I just want to open this PR to have it out of my system, but do not stress about responding/deciding right away. I intend to polish #3219 first.
I've tried to decrease Newsboat's startup time and one idea that I had was to decrease the number of SQL queries to the cache that we currently do. I do it be loading all feeds and (non-deleted) items once in
controller::run(). I benchmarked this for two cases:.pyscript from High RAM usage #3210Both scenarios were done with cold cache (
vmtouch -e <cache_file>between runs). I observe around 33% speedup for real scenario and ~11x speedup for the fake one. I haven't investigated the high win for fake case, but I suspect the win is also fake. :) I've usedScopeMeasureto count the time.The code change feels a bit copy-pasty, but I'm open to polishing it further if we intend to merge this. Let me know what you think.