|
From: | Hermann Peifer |
Subject: | Re: [bug-gawk] Performance observations while using getline: reading from a pipe vs. using a coprocess |
Date: | Mon, 08 Apr 2013 15:30:42 -0300 |
User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 |
On 2013-04-08 14:44, Aharon Robbins wrote:
Hi Hermann. As noted by others, in the pipe case, you are closing and reopening the pipe for *every* input record. This means creating a new process for every input record, whereas for the co-process case, you are doing the close at the end, so you only create one process and you continuosly feed it data.
Thanks for the exlanation. I do understand that the observed performance issue is unrelated to gawk
I suspect that if you change the pipe case to do the close at the end you will see more reasonable performance.
In the given case, this is not an option. Each pipe has an individual name which includes values from the data file. If I don't close the pipe immediately, then sooner or later, I will end up with:
fatal: cannot open pipe `Geod -i --input-string '51.1166 99.7882 -36.1137 -164.263'' (Too many open files)
Thanks again for the time, Hermann
[Prev in Thread] | Current Thread | [Next in Thread] |