[ENH][GOODIE] UnixFileDirectoryPlugin (version 1.2)

David T. Lewis lewis at mail.msen.com
Sat Jan 26 15:11:20 UTC 2002


This cleans up some bugs in the last release, and adds hooks in
the FileDirectory and FileStream classes to make use of the plugin.

>From the preamble:

UnixFileDirectoryPlugin 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. This
enables performance improvements for methods such as
FileDirectory>>entries, FileDirectory>>fileAndDirectoryNames,
FileDirectory>>isAFileNamed, FileDirectory>>fileExists,
UnixFileDirectory>>entryAt:, and similar methods.

On my system:
  FileDirectory>>directoryContentsFor: 7.8X improvement
  FileDirectory>>entryAt:ifAbsent: 32X improvement
  StandardFileStream>>isAFileNamed: 1800X improvement

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) Need to protect against process switching in the middle of
a UnixDirectory>>entries method. The plugin currently used
a static variable pointing at its directory stream. This is a poor
design (although it seems to work fine in practice for me).
2) Do proper integration into the base image, preferably in
conjunction with adding Flow to Squeak.
3) 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.
4) The semantics of #isAFileNamed: are changed. This plugin
checks to see if the file exists, while the base image checks
to see if it exists and can be opened. Either need to change
to exactly match prior semantics, or test to verify that the
change does not break existing applications.

- Dave

-------------- next part --------------
A non-text attachment was scrubbed...
Name: UnixFileDirectoryV1-2-dtl.cs.gz
Type: application/x-gunzip
Size: 7226 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20020126/1d29e072/UnixFileDirectoryV1-2-dtl.cs.bin


More information about the Squeak-dev mailing list