Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is perl faster than awk

Status
Not open for further replies.

sengkannan

Technical User
Jul 8, 2003
13
Hi,
I have an awk script which does lots of mathematical calculation and takes approximately 30 minutes to run.
Will perl be as quick?

Thanks.
 
There's a lot of variables in this request but I think that once the data is in memory that you wouldn't see any appreciable speed difference.

A lot depends on how you access data, how and where you store variables, and whether or not the math functions are built into AWK. And a lot depends on the machine you run the script on.

There's always a better way...
 
Thanks for your advice.
My initial test showed perl to read files faster than awk
so I will go ahead and convert the script to perl manualy.
 
From perldoc perl: (Larry Wall)
[qoute]
If you have a problem that would ordinarily use sed or awk or sh, but it exceeds their capabilities or must run a little faster, and you don’t want to write the silly thing in C, then Perl may be for you. There are also translators to turn your sed and awk scripts into Perl scripts.
[/quote]

Hope this helps...

--jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top