bug-gawk
[Top][All Lists]
Advanced

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

Re: Compiled version of awk program


From: Peng Yu
Subject: Re: Compiled version of awk program
Date: Wed, 30 Jun 2021 04:55:19 -0500

I have already done profiling and found an awk program to be a bottleneck.

I also tried the —profile option to make sure there is nothing in the awk
program to be improved.

Although it is slow, it would not be worthwhile to manually translate awk
code to C as the C code would be too complicated and hard to maintain.

Therefore, I am looking for an automatic way to speed up an awk program.

On Wed, Jun 30, 2021 at 2:40 AM Bob Proulx <bob@proulx.com> wrote:

> Peng Yu wrote:
> > I am trying to speed up awk programs. But I don't find a working
> solution.
> >
> > I see this program which compiles awk code into C. But I don't know
> > where its source package is.
> >
> > https://www.mkssoftware.com/docs/man1/awkc.1.asp
>
> MKS Software, now PTC MKS, is as far as I know proprietary software.
> I could not find a clear license statement after a search of their
> site.  MKS has been around a long time.  There is no source available.
> Although at one time I recall MKS offering a source license.  But it
> is definitely not Free Software.
>
> > Does anybody know what is the current way to speed up awk programs?
>
> Generally programs may be speeded up by using better algorithms.
> Almost invariably improved algorithms result in the best performance.
>
> Before optimizing a program for performance it is necessary to profile
> the program to understand where the time is being spent.  Benchmark
> and profile to obtain data before any attempt at optimization.
> "Premature optimization is the root of all evil." --Tony Hoare.
>
> https://www.gnu.org/software/gawk/manual/html_node/Profiling.html
>
> AWK is an interpreted language.  Interpreted programs intrinsically
> have some level of program overhead.  If you think you have the best
> performing algorithms then one might convert to a compiled language
> such as C, Rust, Go-lang, or other efficient compiled programming
> language.
>
> Bob
>
> --
Regards,
Peng


reply via email to

[Prev in Thread] Current Thread [Next in Thread]