Re: File I/O performance pitfalls

2019-10-25 Thread 9898287 via Digitalmars-d-learn
On Saturday, 26 October 2019 at 02:42:04 UTC, rikki cattermole wrote: On 26/10/2019 2:27 PM, 9898287 wrote: [...] You probably want -O3 not -O5. [...] I assume what you intended is: writeln("Hello, ", i); Also for format functions in D you should prefer the templated variation as it

Re: File I/O performance pitfalls

2019-10-25 Thread rikki cattermole via Digitalmars-d-learn
On 26/10/2019 2:27 PM, 9898287 wrote: Hi I want to find out what's causing my file writes to be so slow. I'm setting up buffer and locking the file and writing them to the file. $ cat d.d && ldc2 -O5  d.d && time ./d >> /dev/null You probably want -O3 not -O5. void main() {     import

File I/O performance pitfalls

2019-10-25 Thread 9898287 via Digitalmars-d-learn
Hi I want to find out what's causing my file writes to be so slow. I'm setting up buffer and locking the file and writing them to the file. $ cat d.d && ldc2 -O5 d.d && time ./d >> /dev/null void main() { import std.stdio; stdout.setvbuf(4096); stdout.lock(); foreach(i; 0 ..