Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#54 closed enhancement (fixed)

Auto-increment functionality for stat cache

Reported by: schwa Owned by: schwa
Priority: major Milestone: 2.6
Component: Library Version: 2.5
Keywords: cache, flushing, default size, stat Cc:

Description (last modified by schwa)

(For some background on stat caching read the documentation.)

The default stat cache size is 1000 entries. Though this is enough for most purposes, people from time to time run into the problem of directories with more items than the default cache size. In this case, old entries (further towards the top of the directory) are flushed out to make place for newer stat items. Then, by the time the directory is iterated over, the older entries are gone, so the directory listing is fetched again for each stat call (isdir, getmtime etc.).

I've been thinking about just increasing the default stat cache size, but of course this costs memory which possibly isn't necessary. Maybe an auto-resize feature is a better approach.

Change History (4)

comment:1 Changed 11 years ago by schwa

Status: newassigned
Type: defectenhancement

comment:2 Changed 11 years ago by schwa

Description: modified (diff)

comment:3 Changed 11 years ago by schwa

Resolution: fixed
Status: assignedclosed

Added in [0fb499033581].

comment:4 Changed 11 years ago by schwa

Summary: Auto-resizing functionality for stat cacheAuto-increment functionality for stat cache

Actually this feature should be called "auto-increment", not "auto-resize".

The cache size is never decreased automatically, but can be set with FTPHost.stat_cache.resize. Decreasing the cache size automatically could counter all the positive effects of the increase as ftputil can't know if the cached entries are still needed.

Note: See TracTickets for help on using tickets.