New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Shell scripts run slow on my Macs


Post Reply New Thread Subscribe

 
Thread Tools
brettgrant99
Guest
 
Posts: n/a

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

Thanks,
Brett
QUOTE Thanks
xstep

 
xstep's Avatar
 
Member Since: Jun 25, 2005
Location: On the road
Posts: 3,231
xstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to all
Mac Specs: 2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid

xstep is offline
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.
QUOTE Thanks
brettgrant99
Guest
 
Posts: n/a

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.

Thanks,
Brett
QUOTE Thanks
brettgrant99
Guest
 
Posts: n/a

Quote:
Originally Posted by xstep
...

Why would anyone have 30000 job directories?

...
Its the nature of the simulation work and initial conditions. One set of initial conditions produces a 2d slice of information in a 6 dimensional space, so we simulate a lot. In order to do this we run using gridware (macs are our newest machines - we started out with gridware, but are considering xgrid) and if we run multiple initial conditions in a directory it causes some file writing issues.

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:

Brett
QUOTE Thanks

Post Reply New Thread Subscribe


« How to create a link to a device like /dev/tty.xyz | starting on mac environment »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Yet another reason why I love my Macs sarahsboy18 Schweb's Lounge 27 12-12-2006 08:38 PM
Very Slow Macs in office roamer OS X - Operating System 2 09-12-2005 12:50 PM
Report: So far the new intel macs are slow MadSkillzMan Apple Rumors and Reports 18 06-18-2005 01:07 AM
Why PC people think Macs are slow jcayo11 Switcher Hangout 4 12-18-2004 12:59 PM

All times are GMT -4. The time now is 02:01 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?