aspose file tools
The moose likes Sockets and Internet Protocols and the fly likes Why Firefox is four times faster to download zip file then my own Java program? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply Bookmark "Why Firefox is four times faster to download zip file then my own Java program?" Watch "Why Firefox is four times faster to download zip file then my own Java program?" New topic
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
    
  13

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.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Why Firefox is four times faster to download zip file then my own Java program?
 
Similar Threads
showing icon at the url field
Stability of eclipse
which one is faster in java?
why google chrome sucks
Emacs or Vi?