henrikbjorn/Lurker — pull request #5 by romainneutron (2013-09-21 16:16:37+00:00)
Title: Change DirectoryResource::getModificationTime to return the modified time of the directory itself

Hello,

I've a question about `DirectoryResource::getModificationTime` implementation that have great impact on performance :

I've noted that the modification time value of the DirectoryResource is impacted by the files contained in it (see [implementation](https://github.com/henrikbjorn/Lurker/blob/master/src/Lurker/Resource/DirectoryResource.php#L28-L31)). It seems it could be bypassed, using the directory *mtime* (by removing the previously mentioned lines).
Doing this, I got performance x10 : scanning a folder containing 9300 files in 2400 folders take 0.8 second whereas it takes about 9 seconds with the current implementation.

The `DirectoryResource::getModificationTime` method is only used in [ResourceStateChecker::getChangeset](https://github.com/henrikbjorn/Lurker/blob/master/src/Lurker/StateChecker/ResourceStateChecker.php#L55-L92) to get time modification (useful in case of create / delete).
For the modify event, it could be used (trigger a directory MODIFY event in case its content has changed) **but** it's discarded in the DirectoryStateChecker::getChangetSet (see [implementation](https://github.com/henrikbjorn/Lurker/blob/master/src/Lurker/StateChecker/NewDirectoryStateChecker.php#L35-L38))

So I would consider removing this, feedback appreciated.