[meld] vc._vc: Limit the file information we ask for



commit 2eb4edc0de8f45269d90f770d634ca2c9e0f203d
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Dec 16 10:55:42 2017 +1000

    vc._vc: Limit the file information we ask for
    
    We were asking for the full range of standard:: info, but didn't use
    anything except the display name and whether it was a directory. Since
    the standard namespace includes a *lot* of stuff, such as file type
    sniffing, this was very wasteful.
    
    On large version control hierarchies, this is good for a massive speed
    improvement; I've seen up to 400%.

 meld/vc/_vc.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/meld/vc/_vc.py b/meld/vc/_vc.py
index 5c0aa7a0..90aa98ec 100644
--- a/meld/vc/_vc.py
+++ b/meld/vc/_vc.py
@@ -273,7 +273,8 @@ class Vc(object):
     def get_entries(self, base):
         parent = Gio.File.new_for_path(base)
         enumerator = parent.enumerate_children(
-            'standard::*', Gio.FileQueryInfoFlags.NOFOLLOW_SYMLINKS, None)
+            'standard::display-name,standard::type',
+            Gio.FileQueryInfoFlags.NOFOLLOW_SYMLINKS, None)
 
         for file_info in enumerator:
             if file_info.get_name() == self.VC_DIR:


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