[Top][All Lists]

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

Re: [EXTERNAL] Re: Performance issues using GAWK 3.1.6 ->from Win 2008 t

From: Ed Morton
Subject: Re: [EXTERNAL] Re: Performance issues using GAWK 3.1.6 ->from Win 2008 to Win 2016
Date: Tue, 15 Jun 2021 07:49:45 -0500
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

That script is enormously inefficient as it'll read the whole of Emp_attr.csv once per line of ParentChild.csv. Try changing it to (untested):

    while ( (getline<f2) > 0 ) {
        map[$2] = $1
    sattr = ( $2 in map : map[$2] : "" )

and you should see a significant performance improvement (i.e. orders of magnitude). The only potential problem would be if Emp_attr.csv was too large to fit in memory.


On 6/15/2021 7:31 AM, Koleti, Haritha via Bug reports and all discussion about gawk. wrote:
Two more scripts that are used in the below script.

Emp_att.awk - I am not sending this as it is working fast.

Map_attr.awk  -

while( (getline<f2) > 0)
if ($2==t1)

[http://facebook.com/pseg]<http://www.facebook.com/pseg>        [Twitter] 
<http://www.twitter.com/psegdelivers>         [LinkedIn] 
<http://www.linkedin.com/company/pseg>       [https://www.pseg.com/images/global/WP_LOGOgrey.png] 

-----Original Message-----
From: Koleti, Haritha
Sent: Tuesday, June 15, 2021 7:49 AM
To: 'Eli Zaretskii' <eliz@gnu.org>; arnold@skeeve.com
Cc: wolfgang.laun@gmail.com; bug-gawk@gnu.org; Pereira, Ricardo 
<Ricardo_D.Pereira@pseg.com>; Pirane, Marco <Marco.Pirane@pseg.com>
Subject: RE: [EXTERNAL] Re: Performance issues using GAWK 3.1.6 ->from Win 2008 
to Win 2016

Good Morning Eli,

This is pretty straight forward script that is trying to Map the data between 
two files.  I am waiting on permission from our security team , so my 
team(Ricardo,Marco) can send you the details.

But here is the script .

TYPE  ParentChild.csv|gawk -f Emp_Attr.awk>Emp_Attr.csv      ----> this is fast.
TYPE  ParentChild.csv|gawk -v f2=Emp_Attr.csv -f map_attr.awk>Map_Attr.csv  -> 
this is where it takes time.

complete script in old server win 2008(excel 2010) completes in 10 mins. now on 
new server 2016(excel 2016) takes 90 minutes.

There is NO change in the volume of data in 2 files .


-----Original Message-----
From: Eli Zaretskii <eliz@gnu.org>
Sent: Tuesday, June 15, 2021 7:30 AM
To: arnold@skeeve.com
Cc: wolfgang.laun@gmail.com; bug-gawk@gnu.org; Koleti, Haritha 
Subject: Re: [EXTERNAL] Re: Performance issues using GAWK 3.1.6 ->from Win 2008 
to Win 2016

***CAUTION******CAUTION******CAUTION***This e-mail is from an EXTERNAL address. 
 The actual sender is  (eliz@gnu.org) which may be different from the display 
address in the From: field. Be cautious of clicking on links or opening 
attachments. Suspicious? Report it via the Report Phishing button.  On mobile 
phones, forward message to Cyber Security.

From: arnold@skeeve.com
Date: Tue, 15 Jun 2021 01:51:06 -0600
Cc: bug-gawk@gnu.org, Haritha.Koleti@pseg.com

Wolfgang Laun <wolfgang.laun@gmail.com> wrote:

The durations 10 min and 90 min suggest to me that a lot of i/o is
going on. I have experienced performance changes of a similar order
of magnitude due to changes in the default i/o buffer size.
This is an interesting idea. Eli, what if you supply a binary built
with the following patch?
How does this theory explain the difference between the two Windows versions?  They both 
use the same value of the "optimal" buffer size.

I'd rather see in the script how much I/O it really does, and take it from 
there.  Suppose that it turns out the script invokes other programs a lot, or 
does a lot of computations: then the investigation should go in some other 
direction, right?

The information contained in this e-mail, including any attachment(s), is 
intended solely for use by the named addressee(s). If you are not the intended 
recipient, or a person designated as responsible for delivering such messages 
to the intended recipient, you are not authorized to disclose, copy, distribute 
or retain this message, in whole or in part, without written authorization from 
PSEG. This e-mail may contain proprietary, confidential or privileged 
information. If you have received this message in error, please notify the 
sender immediately. This notice is included in all e-mail messages leaving 
PSEG. Thank you for your cooperation.

reply via email to

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