optimization possible: cache listings of all parents of the current folder

Bug #140480 reported by Leszek Koltunski
2
Affects Status Importance Assigned to Milestone
OBEX FTP Client for GNOME-VFS
New
Undecided
Unassigned

Bug Description

If the phone contains, for instance, the following filesystem tree

C:/
    dirA/
           dirB/
                  dirC/
                         file1

and if we are currently in dirB and we double-click 'DirC' to open it, Nautilus ( and most probably every other file manager ) will
call method 'do_get_file_info' on all parents of the directory being opened and on the directory itself, i.e. on

1) /
2) /C:
3) /C:/dirA/
4) /C:/dirA/dirB/
5) /C:/dirA/dirB/dirC/

It does so to figure out if we have permissions to open the 'dirC'.

Current caching mechanism caches the last listing only, thus this - common - scenario will result in 5 different obexftp transfers.

There appears to be no reason why gnome-vfs-obexftp couldn't cache all listings done during current connection, thus significantly
speeding up browsing.

Additionally, at the end of each 'session of calls' Nautilus will always call method 'do_get_volume_free_space' which results in yet
another obexftp listing of a directory, just to figure out the free space. This also could be cached.

Revision history for this message
Leszek Koltunski (leszek-3miasto) wrote :

I have a working version with full caching. Now I dont have time to prepare proper patches; I am attaching compressed 'src' directory instead.

Changes:

1) make debugging work in more similar fashion to how it works in osso-gwobex
2) define ENABLE_NAUTILUS_WORKAROUND
3) remove trailing slash from om_utils_get_parent_path_from_uri()
4) remove unnecessary call to om_get_folder_listing() from function om_get_file_info_helper()
5) remove unnecessary call to om_connection_invalidate_cache() from function om_chdir_to_uri()
6) cache all folder listings done during current connection ( define MULTIPLE_CACHE in obex-method.c to enable it )

Revision history for this message
Leszek Koltunski (leszek-3miasto) wrote :

Ok, one correction - the above version does not clear cache when a new file is copied to the phone, causing
Nautilus' 'Internal Errors' . I fixed that by adding a call to 'om_connection_invalidate_cache' to the function
'do_create'.

This is a bit excessive as it is enough to just clear cached listing of the directory the file is being copied too.
Also, the file being copied not always appears in Nautilus. One has to hit 'Refresh' to see it.

I have cleaned my changes a bit. I am attaching the only two modified files, om-utils.c and obex-method.c

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.