Re: [PATCH] mingw: emulate write(2) that fails with a EPIPE
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Dec 17, 2015, 17:08 UTC
- Message-ID
- <alpine.DEB.2.20.1512171807480.6483@virtualbox>
- In-Reply-To
- <xmqqegelc9k8.fsf@gitster.mtv.corp.google.com>
Hi Junio,
On Thu, 17 Dec 2015, Junio C Hamano wrote:
Show 16 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes: > > > My intuition (which I honestly did not verify using performance tests) was > > that write() is called *much* more often than, say, open(),... > > My gut feeling agrees with yours, but I do not think the frequency > at which write() is called should be the primary factor when you > decide to make its wrapper inlined. Once you call write(2), you > will hit either the disk or the network doing I/O, and at that point > I'd expect that the cost of making an extra layer of wrapper call > would be lost in the noise. I'd worry a lot more about from how > many callsites write() is called---by inlining the extra code that > is run only when the underlying write(2) returns an error to many > callsites, we would make the program as a whole bigger, and as the > result other code needs to be evicted out of the instruction cache, > which also would hurt performance.
That argument convinced me. v2 coming shortly.
Ciao, Dscho