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

[ale] Bash vs Perl



> From: "Steve Litt" <slitt at troubleshooters.com>
> To: ale at ale.org
> Sent: Wednesday, October 26, 2016 2:05:35 AM
> Subject: Re: [ale] Bash vs Perl

> On Tue, 25 Oct 2016 11:01:40 -0400
> leam hall <leamhall at gmail.com> wrote:

> > On Tue, Oct 25, 2016 at 10:57 AM, Steve Litt
> > <slitt at troubleshooters.com> wrote:

> > > On Mon, 24 Oct 2016 12:08:48 -0400
> > > leam hall <leamhall at gmail.com> wrote:

> > > > My unsolicited opinion, based off using Ruby, is that if the cost
> > > > of a fork is critical use C or Go. Otherwise, "a difference that
> > > > makes no difference is no difference".

> > > Bash **REALLY** slows for fork. Run the test program inside a big
> > > loop. If I remember correctly, it's an order of magnitude slower
> > > than the same loop in Python, all because of spawning test.

> > > High repetition loops in Bash are much worse than in Python or Perl.

> > > SteveT


> > Hey Steve, that was sort of my point. If the fork is run once a day
> > and takes 5 minutes instead of 2, is that really a problem? Granted
> > there are much better technical solutions, but if you only have so
> > much time to code, is the performace gain worth the effort?

> Exactly! Bash is great for most stuff. The exception is iterating
> through a directory with a thousand or so files, and for some reason
> run the test executable on each. That could take 10 minutes for bash as
> opposed to 30 seconds for Python and 8 seconds for C (these timings are
> my best guesses).

I feel the need to explain my disclaimer: 

I'm not bashing bash. :) 

For this project I need to use bash because it is available much earlier than Perl would be in the build. This would work be faster if I had a book that showed how to do X in Y (bash). 

To some extent I am doing this via google by doing searches on "How do I do X in bash" 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20161026/a95bb5b1/attachment.html>