[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Efficient code



Richard Christensen writes:
|When doing modification searches for files, is it quick in computation 
|time to use stat() or to use SFpGetCatInfo().
|If I had to bet, I would say the native Mac call would be faster.  Would 
|I win.?

I suspect stat calls something like FSpGetCatInfo and shuffles some fields
about, so the native call might be slightly faster, but any gain is
probably swamped by the trap itself and the file system gathering up the
info.

Why don't you do some timing tests? Write two subs--one that traverses
a directory tree doing stat's, and another that traverses a tree doing
FSpGetCatInfo's, then use Benchmark to time them. And send your results
to the list, I'd be interested in seeing what you find out.

Brian

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch