In general yes.

Of course 64k would be the optimal value for buffer size for both windows and 
linux. However, I think iostream is an old thing. Setting it as optimal value 
might create compatibility issues.

Yes. This patch is good.

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: Jonathan Wakely<mailto:jwak...@redhat.com>
Sent: Friday, October 2, 2020 18:04
To: sotrdg sotrdg<mailto:euloa...@live.com>
Cc: libstdc++<mailto:libstd...@gcc.gnu.org>; 
gcc-patches@gcc.gnu.org<mailto:gcc-patches@gcc.gnu.org>
Subject: Re: This is my patch for fstream to fix the performance issue on 
Windows.

On 01/10/20 03:29 +0000, sotrdg sotrdg via Libstdc++ wrote:
>From fb8d644a4c315058af141a3e84fcc083d665c8b9 Mon Sep 17 00:00:00 2001
>From: ejsvifq_mabmip <euloa...@live.com>
>Date: Wed, 30 Sep 2020 23:26:47 -0400
>Subject: [PATCH] Fix a long term performance issue of fstream on Windows since
>MSVCRT defines BUFSIZ as 512 which causes the serious downgrade of I/O
>performance.
>
>Even stdio itself is using 4096 as real buffer size, the behavior should be 
>the same as FILE* on Windows.

The attached patch seems a cleaner approach. Does it solve your
performance issues?

Reply via email to