[gvfs/wip/oholy/google-shared-drives-support: 39/43] google: Increase number of results in batches for better performance




commit 530b55586461206f5c836e8b3a9e6625c560474e
Author: Ondrej Holy <oholy redhat com>
Date:   Fri Jan 29 14:06:16 2021 +0100

    google: Increase number of results in batches for better performance
    
    Currently, only 50 results are returned in one batch, which means that
    multiple network requests are needed for folders with a lot files, which
    makes it slow. I am not sure there was some reason for this limitation
    earlier (e.g. before the cache rework), however, I don't see any
    rationals for it currently. Let's increase this to its maximum for
    better performance.

 daemon/gvfsbackendgoogle.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
---
diff --git a/daemon/gvfsbackendgoogle.c b/daemon/gvfsbackendgoogle.c
index 777acb8a..1b5db93c 100644
--- a/daemon/gvfsbackendgoogle.c
+++ b/daemon/gvfsbackendgoogle.c
@@ -80,8 +80,6 @@ G_DEFINE_TYPE(GVfsBackendGoogle, g_vfs_backend_google, G_VFS_TYPE_BACKEND)
 
 #define CONTENT_TYPE_PREFIX_GOOGLE "application/vnd.google-apps"
 
-#define MAX_RESULTS 50
-
 #define REBUILD_ENTRIES_TIMEOUT 60 /* s */
 
 #define URI_PREFIX "https://www.googleapis.com/drive/v2/files/";
@@ -907,7 +905,7 @@ rebuild_dir (GVfsBackendGoogle  *self,
   parent_id = g_strdup (gdata_entry_get_id (parent));
 
   search = g_strdup_printf ("'%s' in parents", parent_id);
-  query = gdata_documents_query_new_with_limits (search, 1, MAX_RESULTS);
+  query = gdata_documents_query_new_with_limits (search, 1, G_MAXUINT);
   gdata_documents_query_set_show_folders (query, TRUE);
   g_free (search);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]