[ENH][GOODIE] DirectoryPlugin version 1.3 (was UnixFileDirectoryPlugin)

David T. Lewis lewis at mail.msen.com
Wed Feb 13 12:28:32 UTC 2002


DirectoryPlugin runs on Unix and Windows, and provides a noticable
improvement in many directory and file access methods. If you use
CommandShell on Unix (Linux), you should see an overall 15X
improvement based on timing the CommandShell SUnit tests with
and without DirectoryPlugin.

Formerly called UnixFileDirectory, this version is rewritten
to permit multiple file streams to be manipulated by different
Smalltalk processes. It is renamed to reflect cross platform
support, currently Unix and Windows. Other platforms have not
been tested.

DirectoryPlugin provides access to file stat calls, which
provides significant improvement to methods such as
FileDirectory>>isAFileNamed, FileDirectory>>fileExists,
UnixFileDirectory>>entryAt:, and similar methods.

DirectoryPlugin provides a significant improvement in
directory access speed on platforms with Posix style directory
streams. It provides primitives for access to opendir(), readdir()
and related calls, as well as stat() calls on named files. On Unix
systems, this enables performance improvements for methods such
asFileDirectory>>entries and FileDirectory>>fileAndDirectoryNames.
The primitives run on Windows also, but do not improve
performance.

This change set hooks the directory stream primitives into
UnixFileDirectory so they are in effect only for Unix systems.
It hooks the file stat primitives into StandardFileStream and
FileDirectory, so they provide performance improvements
for both Windows and Unix systems.

Performance improvement on my system, running Linux:
  FileDirectory>>directoryContentsFor: is 7.3 times faster
  FileDirectory>>entryAt:ifAbsent: is 148 times faster
  FileDirectory>>fileAndDirectoryNames is 5.2 times faster
  FileDirectory>>fileExists: is 121 times faster
  FileDirectory>>directoryExists: is 104 times faster
  FileDirectory>>fileOrDirectoryExists: is 32 times faster
  StandardFileStream>>isAFileNamed: is 1445 times faster

Performance improvement on my system, running Windows:
  FileDirectory>>directoryContentsFor:  (N/A)
  FileDirectory>>entryAt:ifAbsent: (N/A)
  FileDirectory>>fileAndDirectoryNames 1.37 times faster
  FileDirectory>>fileExists: 86 times faster
  FileDirectory>>directoryExists: 80 times faster
  FileDirectory>>fileOrDirectoryExists: 90 times faster
  StandardFileStream>>isAFileNamed: 497 times faster

Primitive access methods are provided on the class side of
UnixFileDirectoryPlugin in order to prevent pollution of the
current FileDirectory and FileStream hierarchies. Hooks are
put into UnixFileDirectory and StandardFileStream to make use
of the plugin with the fewest possible changes to these classes.

Performance test methods are also provided on the class side of
the plugin to profile the code and demonstrate the performance
differences.

To do:
  1) Do proper integration into the base image, preferably in
  conjunction with adding Flow to Squeak.
  2) Write SUnit tests to verify correct operation under all the
  permutations of read/write/execute permissions on files and
  directories I've already squashed some ugly bugs here, and
  need to test to make sure I've gotten them all.
  3) The semantics of #isAFileNamed: are slightly changed. Need
  to test to verify that the change does not break existing
  applications.
  4) Test DirectoryPlugin with SecurityPlugin. Make sure the
  security functions in DirectoryPlugin work, and find out how
  much performance degradation accurs with security turned on.

Dave

-------------- next part --------------
A non-text attachment was scrubbed...
Name: DirectoryPluginV1-3-dtl.cs.gz
Type: application/x-gunzip
Size: 14261 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20020213/0ebf49f8/DirectoryPluginV1-3-dtl.cs.bin


More information about the Squeak-dev mailing list