in reply to Displaying a Large File
Opening the file will take a few milliseconds. Reading the whole thing a few milliseconds more. This is not your problem. Nor is memory an issue - this is a small file. Read it line by line or slurp it all in. It does not matter.
Your problem is bandwidth. Let's say 15 chars per address 15 * 20,000 = 300,000 bytes. Sending 300,000 bytes (300kB) across the internet embedded in an HTML form (scrolling text box) is what takes the time. I assume this is what you are doing given the context.
A 56k modem gets a max of 56,000 bits per second. Let's be optimistic and assume you actually get this. There are 8 bits in a byte so a 56K modem is good for 56,000 / 8 = 7000 bytes per second. So we now understand that 300,000 / 7000 = 42 seconds download. This is the minimum. In the real world double it or more as 56K only happens in perfect conditions. If you want speed you need to change your logic and limit the download.
There are some tricks you can use to get the partially downloaded data to render (display) faster but if you want zeus@zod.com you will be waiting until it all comes down.
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
|
|---|