Is there a way to speed up Jsoup.parse ()?

I am using the entire string version of Jsoup.parse ():

parse(String html, String baseUri) 

Converting connection speeds to compare performance.

It takes 9 seconds for an ordinary inexpensive Android phone to call Jsoup.parse() on an html String of a not-so-rare long Wikipedia page (~ Jsoup.parse() !

My client does not want to accept this delay, and I think that either Jsoup dumping for another engine, either alone processes web pages (still in Java), or uses some C / C ++ parser in NDK ( if available).

But I prefer to use Jsoup as much as possible.

Is there a way to speed up Jsoup.parse() ?

+7
source share
1 answer

What I'm trying to do with large pages ( if possible , and you only need the information on the page), try to minimize the text to parse earlier the regions you want, and then look for regions using JSoup.

This way you can combine your own analysis in Java to reduce data, and then use JSoup for the product.

+5
source

All Articles