user650585
user650585

Reputation: 323

Java is slower than the browser in opening URL stream

I am reading a url using

new URL(url).openStream();

and realized that it takes three times longer than what it takes for the browser according to fireBug. The openStream() method takes a little bit more than a second but the browser reads the whole thing in 300 ms. Can some one tell me how I can optimize it in Java?

Upvotes: 1

Views: 187

Answers (1)

Dmitry Zaytsev
Dmitry Zaytsev

Reputation: 23962

Using native code.

Problem is that code in Java works not so fast, as browser created using webkit or native code.

Upvotes: 1

Related Questions