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: Wolfgang Laun
Subject: Re: Compiled version of awk program
Date: Wed, 30 Jun 2021 12:20:41 +0200

What factor would you consider as sufficient for a speed improvement?
On what do you base your surmise that a translation to C will improve the
overall speed of this awk program by this factor?
What makes you certain that there is no algorithm that can be improved?

-W


On Wed, 30 Jun 2021 at 11:55, Peng Yu <pengyu.ut@gmail.com> wrote:

> 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
>


-- 
Wolfgang Laun


reply via email to

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