Re: Improving IO Speed

2014-05-09 Thread flamencofantasy via Digitalmars-d-learn
Try this; import std.mmfile; scope mmFile = new MmFile(T201212A.IDX); TaqIdx* arr = cast(TaqIdx*)mmFile[0..mmFile.length].ptr; for (ulong i = 0; i mmFile.length/TaqIdx.sizeof; ++i) { // do something... writeln(arr[i].symbol); } On Friday, 14 March 2014 at 18:00:58 UTC, TJB wrote: I

Re: Improving IO Speed

2014-03-21 Thread Marc Schütz
On Friday, 14 March 2014 at 18:00:58 UTC, TJB wrote: align(1) struct TaqIdx { align(1) char[10] symbol; align(1) int tdate; align(1) int begrec; align(1) int endrec; } Won't help with speed, but you can write it with less repetition: align(1) struct TaqIdx { align(1): char[10]

Re: Improving IO Speed

2014-03-15 Thread Artem Tarasov
Did you try setvbuf method of std.stdio.File?

Re: Improving IO Speed

2014-03-14 Thread bearophile
TJB: Do you have any suggestions for improving the speed in this situation? I have never used readExact so far, so I don't have many suggestions. But try to not pack the struct. Bye, bearophile

Re: Improving IO Speed

2014-03-14 Thread monarch_dodra
On Friday, 14 March 2014 at 18:26:36 UTC, bearophile wrote: TJB: Do you have any suggestions for improving the speed in this situation? I have never used readExact so far, so I don't have many suggestions. But try to not pack the struct. Given he's using a raw read, I suspect he doesn't

Re: Improving IO Speed

2014-03-14 Thread monarch_dodra
On Friday, 14 March 2014 at 18:00:58 UTC, TJB wrote: Do you have any suggestions for improving the speed in this situation? Thank you! TJB I expect you'd get better performance with std.stdio rather than std.stream. stream is class based and (AFAIK) not as optimized for performance. I'd

Re: Improving IO Speed

2014-03-14 Thread Craig Dillabaugh
On Friday, 14 March 2014 at 18:00:58 UTC, TJB wrote: I have a program in C++ that I am translating to D as a way to investigate and learn D. The program is used to process potentially hundreds of TB's of financial transactions data so it is crucial that it be performant. Right now the C++

Re: Improving IO Speed

2014-03-14 Thread TJB
On Friday, 14 March 2014 at 19:11:12 UTC, Craig Dillabaugh wrote: On Friday, 14 March 2014 at 18:00:58 UTC, TJB wrote: I have a program in C++ that I am translating to D as a way to investigate and learn D. The program is used to process potentially hundreds of TB's of financial transactions