At 10:22 AM -0500 1/22/00, Chris Nandor wrote: >At 7.40 +0000 2000.01.22, Bart Lateur wrote: > >One thing I found out, is that MAcPerl is TERRIBLY slow to simply list > >the whole contents of a CD, using File::Find, or using readdir() and the > >file operators (-X). I'm talking about *hours*, for just *one* CD. > >Actually, I tried to list the contents of a CD, with size and file info, > >not more than a few directories with a few hundred files, and I had to > >interrupt it after 4 hours. Less than half of the files were processed > >in this time. > >Odd. I have a CD with 856 items (files and folders) and this script runs >in one second: > > #!perl -wl > use File::Find; > find(sub { push @a, $File::Find::name }, 'Neely:'); > print scalar @a; > print time - $^T; > >Some information had been cached (I know this because I am on battery, and >on sunsequent runs, the CD did not even bother to spin up :), so I popped >in a CD that this machine had never seen before, with 5243 items, and it >took 24 seconds. > >PowerBook G3/400, Mac OS 9, DVD-ROM (I forget what speed it spins CDs at). Same here, only the first CD I found only had 79 files. MacOS 9, iBook, CD is a 16x (I think) IDE. 1 second with your script. Of course, he did say size and file info. Making a few modifications and turning it into a droplet: #!perl -wl use File::Find; find(sub { push @a, $File::Find::name; push @b, -s $File::Find::name; push @c , (-d $File::Find::name || -l $File::Find::name) ? ("DIR","DIR") : MacPerl::GetFileInfo($File::Find::name)}, shift); print scalar @a; print time - $^T; sleep 3; for($i = 0, $j = 0;$i < @a; $i++, $j++) { print "$a[$i] $b[$i] $c[$j++], $c[$j]"; } Now it takes 2 seconds for the same data CD, burnt on my Mac running Linux as a Mac/ISO hybrid. I just remembered I have a more taxing CD, so I tried it. That one has 544 files and takes 84 seconds. And you're right, after the first time the drive doesn't spin up. I can believe that it matters a great deal what kind of CD drive (IDE or SCSI), which OS, and what controller's inside. On my Performa 6400 running MacOS 8.6 it takes about 15 minutes for a CPAN.pm "r", during which time I can't do anything else. That's on the IDE drive. When the same box is running Linux on my SCSI drive, it takes a minute or less and, of course, I can do anything else I want. (I avoid using the MacOS drive when running Linux, so I don't know whether I'd have the same problems or not. The new kernel, 2.2.14, seems to have much improved IDE drivers, though.) On the iBook (IDE internal), I can run a CPAN "r" in a minute or so, and can put MacPerl in the background and do other things while doing it. > >-- >Chris Nandor mailto:pudge@pobox.com http://pudge.net/ >%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6']) -- Paul Schinder schinder@pobox.com # ===== Want to unsubscribe from this list? # ===== Send mail with body "unsubscribe" to macperl-request@macperl.org