Re: Read large ascii file quickly [message #74300 is a reply to message #74299] |
Thu, 06 January 2011 13:57   |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
On Jan 6, 7:53 pm, Paulo Penteado <pp.pente...@gmail.com> wrote:
>> I have to read a large ascii file (2.5e+07 lines) into a 5000x5000 intarr. The code below works fine but it takes roughly 15-20min on my machine( not the oldest :) ). Any suggestions how to accelerate this?
>
>> CODE:
>
>> OPENR, unit, file, /GET_LUN
>
>> result = INTARR(5000,5000, /NOZERO)
>> count=0d
Also, it would be better to count with integers. With a long
(initialized 0L) you can count up to 2^31-1, with ulong (0UL) up to
2^32-1, exactly (without the loss of precision that would eventually
happen with doubles). Those are long enough that the time to count to
that will be an issue before the count overflows, but there are also
the much larger long64 and unsigned long64.
|
|
|