in reply to read huge file
You asked about read and sysread already, so you know about other ways.
There are two possibilities: either the parsing code is too slow (you can find that out by profiling, as was previously suggested to you), or it's really the IO that's slow. If that's the case, using a different method to read the file won't speed it up significantly. All you can do is obtaining a faster system.
Update: on my system it takes about 3.2 seconds to read 1GB with an ordinary while (<$handle>) loop, and about 1.4 seconds to read it with sysread. (The file might be still in the IO buffers of my operating system). So maybe it's really your parsing code that's being slow, not the IO?
See also: reading file. Repeating your questions (and phrasing them slightly different) won't help you at all.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
| A reply falls below the community's threshold of quality. You may see it by logging in. |