ilang commented on PR #758:
URL: https://github.com/apache/commons-vfs/pull/758#issuecomment-4192482660

   Hi @garydgregory,
   
   I have found a performance regression introduced by this PR when using 
CacheStrategy.ON_RESOLVE with FTP directories containing many files.
   
   The childMap = null added to FtpFileObject.refresh() interacts badly with 
ON_RESOLVE: 
   when iterating children after findFiles(), each child's getParent() 
re-resolves the parent via fileSystem.resolveFile(). With ON_RESOLVE, this 
triggers parent.refresh(), which now clears childMap unconditionally — forcing 
a new LIST command for every child.
   
   Before this PR, childMap was only cleared via doDetach() (guarded by if 
(attached)). When the parent was already detached (after the first child 
triggered a refresh), subsequent children found childMap intact and reused it. 
Now it's cleared on every refresh regardless of attach state.
   
   Impact: A directory with N files produces ~N LIST commands per child 
enumeration instead of 1-2. We observed ~80 LIST commands for 50 files in a 
test, and significantly degraded hot-folder (which is one of the things we are 
using vfs for) performance with ~1000 files in production.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to