summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-François Fortin Tam <nekohayo@gmail.com>2022-10-08 12:24:02 -0400
committerAntónio Fernandes <antoniof@gnome.org>2022-10-21 16:26:22 +0000
commit32a9753c782daa682563b6f6eb923d3f112d6b94 (patch)
tree71ca18b4aaa5e9dc8024c29d8bbcae7b8ba0212a
parent26e7dd0975d45cba33223dab957cf8baed813030 (diff)
downloadnautilus-32a9753c782daa682563b6f6eb923d3f112d6b94.tar.gz
query-editor: Lengthen search activation timeout to improve performance
A more realistic default delay avoids spamming the search backends. While it does not solve every perf issue, it's an improvement. Fixes issue #1731
-rw-r--r--src/nautilus-query-editor.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nautilus-query-editor.c b/src/nautilus-query-editor.c
index b671d818f..78719d457 100644
--- a/src/nautilus-query-editor.c
+++ b/src/nautilus-query-editor.c
@@ -84,7 +84,11 @@ static void nautilus_query_editor_changed (NautilusQueryEditor *editor);
G_DEFINE_TYPE (NautilusQueryEditor, nautilus_query_editor, GTK_TYPE_WIDGET);
-#define SEARCH_CHANGED_TIMEOUT 150
+/* A hunt-and-peck typist types at 25-35 words per minute, which means 342 to 480ms between strokes.
+ * An average touch typist types at 50-70 wpm, which means 171 to 240ms "under ideal conditions".
+ * A 150ms default search triggering delay is too short even for fast typists in general,
+ * so wait 400ms after typing, to improve performance by not spamming search engines: */
+#define SEARCH_CHANGED_TIMEOUT 400
static void
update_fts_sensitivity (NautilusQueryEditor *editor)