06-21-2006, 06:38 PM #1brettgrant99GuestShell scripts run slow on my Macs
I have a shell script that determines the status of a job directory.
When I run this script on my linux boxes for 100 directories, it takes about 2 minutes.
When I run it on my macs (G5 2.0 Ghz machines) and 100 directories, it takes about 11 minutes.
The linux boxes are similar type machines, dual processor 2.2 Ghz Opterons, so I wouldn't expect a big discrepency.
The real problem is that I have something like 30000 directories to go though, so right now it takes a bit of time.
Just wondering if anyone has any ideas. I am thinking about coding it up in perl and running it that way. Of course I would have to learn perl to do that. :headphone
06-21-2006, 11:01 PM #2
- Member Since
- Jun 25, 2005
- On the road
- 2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
Assuming the two directories contain the exact same thing, then perhaps it has something to do with the priority that the system gives to your scripts or the terminal process.
Perhaps one or more external commands are slower on the Mac?
Why would anyone have 30000 job directories?
If the script is complicated enough, I'd put some statements in to echo the time or time differences and try to figure out if it is one location of the code being slower on the Mac compared to the Linux box.
I can't see Perl giving you any advantages over an already working shell script.
If you figure out the real answer, please give us an explanation.
06-22-2006, 10:47 AM #3brettgrant99Guest
I rewrote the script in perl, very ugly perl, but performance is now about the same on all of my systems. Very odd. I don't really understand that, but it gives me my end result.
The perl script is ~ 400 loc, while the shell was ~100.
Maybe later, I'll try and figure out the differences.
06-22-2006, 10:58 AM #4brettgrant99GuestOriginally Posted by xstep
BTW - thats 30000 on one mac network. I have another mac network that is smaller that has something like 5000 directories, and a sun network, and a network of dual-processor opterons, and a network of quad-processor opterons, and a network of dual-xeon boxes. Over 100k directories total. Each directory has between 10 and 50k files, although we can clean up the directories in a postprocessing step. This eats up the inodes fast. :black:
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
By vansmith in forum News and Community AnnouncementsReplies: 9Last Post: 04-14-2014, 05:27 AM
By kc0mmy in forum OS X - Operating SystemReplies: 6Last Post: 10-06-2010, 08:31 AM
By johncpvt in forum OS X - Apps and GamesReplies: 0Last Post: 07-10-2008, 03:18 PM