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
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
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
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
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