[ale] Bash vs Perl
Lightner, Jeffrey
JLightner at dsservices.com
Mon Oct 24 15:51:59 EDT 2016
You can avoid a lot of performance drain from doing multiple processes based on large files but putting the file into an array in bash then doing your subsequent processing against that array. It eliminates the disk reads that would otherwise make things go to a crawl. Of course you can (and usually do) do that in Perl and other languages.
The reason Perl is typically more efficient is it isn’t having to invoke subshells for calls to modules/routines whereas bash and other shells do.
From: ale-bounces at ale.org [mailto:ale-bounces at ale.org] On Behalf Of Ed Cashin
Sent: Monday, October 24, 2016 3:35 PM
To: Atlanta Linux Enthusiasts
Subject: Re: [ale] Bash vs Perl
A few times (in the mid 2000s) I prototyped in shell only to switch to ruby to avoid the overhead of forking. It was still a huge performance improvement, even with the interpreted language. It depends a lot on what the program is doing.
On Mon, Oct 24, 2016 at 12:55 PM, leam hall <leamhall at gmail.com<mailto:leamhall at gmail.com>> wrote:
I'm not sure I know a lot of Ruby either, but the logic is the same. Calling sub-programs is expensive in terms of minute measurements. Overall, if you fork 25 time in one day, what's the actual impact? If you fork 2500 times a second for several hours straight, then you probably want a compiled language.
On Mon, Oct 24, 2016 at 12:48 PM, Chris Fowler <cfowler at outpostsentinel.com<mailto:cfowler at outpostsentinel.com>> wrote:
________________________________
From: "leam hall" <leamhall at gmail.com<mailto:leamhall at gmail.com>>
To: "Atlanta Linux Enthusiasts" <ale at ale.org<mailto:ale at ale.org>>
Sent: Monday, October 24, 2016 12:08:48 PM
Subject: Re: [ale] Bash vs Perl
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".
I don't know Ruby, but I'm sure you can text processing without executing awk, cut, sed, tr, and their other friends. I'm talking about the expense when you need to do processing that would require call those programs. The annoyances of those friends is the subject of another day. :)
_______________________________________________
Ale mailing list
Ale at ale.org<mailto:Ale at ale.org>
http://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
--
Mind on a Mission<http://leamhall.blogspot.com/>
_______________________________________________
Ale mailing list
Ale at ale.org<mailto:Ale at ale.org>
http://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
--
Ed Cashin <ecashin at noserose.net<mailto:ecashin at noserose.net>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20161024/05ceee38/attachment.html>
More information about the Ale
mailing list