Thread overview
[Issue 7033] File.rawWrite is slow on Windows
Aug 03, 2014
Orvid King
Aug 13, 2020
Dlang Bot
Aug 15, 2020
Dlang Bot
July 08, 2014
https://issues.dlang.org/show_bug.cgi?id=7033

andrea.9940@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |industry
                 CC|                            |andrea.9940@gmail.com
           Hardware|x86                         |All

--
August 03, 2014
https://issues.dlang.org/show_bug.cgi?id=7033

--- Comment #1 from Orvid King <blah38621@gmail.com> ---
The reason for this is because rawWrite calls flush, not once, but twice every time you call it, on the underlying file. This is absolutely absurd, and is a massive performance bottleneck, especially when it's not needed because the file may very well have already been opened for writing in binary mode to begin with. In this particular example, it's flushing to disk every 3 bytes.

--
July 27, 2020
https://issues.dlang.org/show_bug.cgi?id=7033

Steven Schveighoffer <schveiguy@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schveiguy@yahoo.com

--- Comment #3 from Steven Schveighoffer <schveiguy@yahoo.com> ---
Just was doing some development and found this same bug. This is absolutely unnecessary, especially if the file is already open in binary mode. We currently don't store what mode the file is in, but we absolutely could (we are allocating a heap struct for this, no reason we can't store that). And only switch if necessary.

This should be an easy change and I'm kind of surprised this has been open for so long.

--
August 13, 2020
https://issues.dlang.org/show_bug.cgi?id=7033

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #4 from Dlang Bot <dlang-bot@dlang.rocks> ---
@canopyofstars created dlang/phobos pull request #7590 "Fix issue 7033: File.rawWrite is slow on Windows" fixing this issue:

- Fix issue 7033

https://github.com/dlang/phobos/pull/7590

--
August 15, 2020
https://issues.dlang.org/show_bug.cgi?id=7033

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/phobos pull request #7590 "Fix issue 7033: File.rawWrite is slow on Windows" was merged into master:

- 8643ecad370508f6adf7ba2a34eee1924e47a2f7 by starcanopy:
  Fix issue 7033

https://github.com/dlang/phobos/pull/7590

--