Re: About File.rawWrite

2011-11-29 Thread Ali Çehreli
On 11/29/2011 01:20 PM, torhu wrote: On 29.11.2011 16:00, Denis Shelomovskij wrote: Your OS is Windows, right? On Windows, rawWrite and rawRead always flushes stream, sets binary mode, reads/writes, flushes stream again, sets previous mode. This is definitely unnecessary slow - at least it shou

Re: About File.rawWrite

2011-11-29 Thread Kai Meyer
On 11/29/2011 08:00 AM, Denis Shelomovskij wrote: 29.11.2011 15:57, bearophile пишет: This D2 program runs in about 5.13 seconds on my PC: import std.stdio; void main() { auto f = File("bytes_test.dat", "wb"); ubyte[3] RGB; foreach (_; 0 .. 1_000_000) f.rawWrite(RGB); } While this C program

Re: About File.rawWrite

2011-11-29 Thread torhu
On 29.11.2011 16:00, Denis Shelomovskij wrote: Your OS is Windows, right? On Windows, rawWrite and rawRead always flushes stream, sets binary mode, reads/writes, flushes stream again, sets previous mode. This is definitely unnecessary slow - at least it should change mode only if needed (the fil

Re: About File.rawWrite

2011-11-29 Thread Denis Shelomovskij
29.11.2011 15:57, bearophile пишет: This D2 program runs in about 5.13 seconds on my PC: import std.stdio; void main() { auto f = File("bytes_test.dat", "wb"); ubyte[3] RGB; foreach (_; 0 .. 1_000_000) f.rawWrite(RGB); } While this C program runs in about 0.14 seconds

About File.rawWrite

2011-11-29 Thread bearophile
This D2 program runs in about 5.13 seconds on my PC: import std.stdio; void main() { auto f = File("bytes_test.dat", "wb"); ubyte[3] RGB; foreach (_; 0 .. 1_000_000) f.rawWrite(RGB); } While this C program runs in about 0.14 seconds: #include int main() { FILE *f = f