So I finally got Devel::Profile working. It would not work unless I set the PERL_PROFILE_FILENAME to the absolute path of the file that I wanted. Anyway, it seems that I wasn't really comparing apples to apples. One of the things the script has to do is get some data from files that may are may not be zipped up. Most of the time is being taken up by calling the Compress::Zlib routines. It turns out the directory with 625 entries has 437 zipped files, while the one with 1125 entries only had 127 zipped files.
Since curiosity killed the cat, I moved the data on the macs to the Xeon and ran with profile. So, with identical data and perl scripts I get: Mac: 87.8 seconds, with 30 seconds in Compress and 30 sec in <other> Xeon: 64 seonds, with 15 seconds in Compress and 35 sec in <other> Anyone have any insight into what other is? I 'm assuming that these are the system calls to gridware. Thanks, Brett Grant Sherm Pendley <[EMAIL PROTECTED]> 02/27/2007 09:45 AM To [EMAIL PROTECTED] cc [email protected] Subject Re: perl code on mac slow On Feb 27, 2007, at 11:24 AM, [EMAIL PROTECTED] wrote: > I have a server where the computer that I log into is a Mac Xserver > 2.2 > GHz Dual Processor machine with 2G ram. I wrote some perl code to > figure > out what is going on with Gridware. Essentially it compares what > gridware > thinks that it is doing with the files that are in the specific > directory. > I am kind of new to perl, so I may not have written the best code, > but it > works ok for me. Anyway, I developed the code on this mac machine. > > When I run the code to check on 625 files in one directory it took > about a > minute. I checked and the machine is 90% idle. > > Now when I run this identical code on my Xeon 1.8 GHz machine with > 4 G ram > where it checks 1125 files in one directory (unfortunately I don't > have > the exact same data on both systems) it takes just 10 seconds. > This is > on a slower machine with more users logged in! > > The mac box has perl ver 5.8.6. The xeons have perl 5.8.5. > > Is there something I can check on to see what is going on? Its almost > like the mac doesn't use all of its resources when it runs the code. Mac OS X doesn't throttle processes that I know of, so if your CPU is at 90% idle, your script is probably waiting on either disk or network IO. You could try profiling your script with Devel::DProf to get a breakdown on where the time is being spent in your script. Another very simple benchmark is to run your script with "time myscript.pl". That will report the real (i.e. wall clock) time spent, the user (i.e. your script) time, and the sys (i.e. OS) time. Time spent waiting on disk or network is reported as sys time here. sherm-- Web Hosting by West Virginians, for West Virginians: http://wv-www.net Cocoa programming in Perl: http://camelbones.sourceforge.net
