| Author |
Why Firefox is four times faster to download zip file then my own Java program?
|
Boris Osipchuk
Greenhorn
Joined: Jul 25, 2009
Posts: 2
|
|
I tried using regular IO or NIO but Firefox always beats it by being about 4 times faster. Is there something special they are using?
For example, I tried downloading eclipse distributions and needed about 40 minutes for like 360 MB and Firefox did in 10 minutes.
I will post the code, if requested, but hope this is something beyond my code.
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
Perhaps Firefox uses multiple connections to download from, then pastes the contents together on your PC.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24057
|
|
Let's see your loop for actually reading/ writing, and maybe something will jump out at us. I suspect some of that speed comes from using multiple buffers in rotation, and reading and writing from dedicated threads, but there are some very basic things -- using a large - enough buffer, for example -- that can make a difference.
|
[Jess in Action][AskingGoodQuestions]
|
 |
Boris Osipchuk
Greenhorn
Joined: Jul 25, 2009
Posts: 2
|
|
Hi guys, I have tried to break it up into four threads, as Rob suggested, by I don't know multi-threading very well, so what I get is I can see that 4 files are being created but only one file is being populated with data. After that is done the application terminates and 3 other files don't contain any data.
Here's my downloader class.
and here's how I call it.
|
 |
 |
|
|
subject: Why Firefox is four times faster to download zip file then my own Java program?
|
|
|