commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Andrich <>
Subject Readers in common net NNTP package
Date Wed, 26 May 2004 20:07:25 GMT
Hi everybody,

I am toying around with an NNTPClient to retrieve some news articles for 
further processing, and I did some benchmarking. May I have some mis 
conceptions or missing out something completely, but basically I do

        Reader reader = this.nntpClient.retrieveArticleInfo(start, end);

        System.out.println(new Date());
        StringBuffer sb = new StringBuffer();
        char[] b = new char[1024];
        int n=0;
        while ((n = > 0) {
            // sb.append(b, 0, n);
        System.out.println(new Date());

And this takes about 40 seconds, if start and end are about 20.000 
apart. So, I have a simple question, after the call to 
NNTPClient.retrieveArticle is the complete XOVR information already 
transmitted to the client, or is it read when I access the reader? The 
later would be a sufficient information for the performance difference 
compared to a StringReader which is based on a String containing 30.000 
"lines" (read it as 30.000 \n terminated Strings concatenated to one 

If someone can comment on this and may be show me, how I can get the job 
done faster, then I would be more than happy. The reason why I like to 
tweak it, is that I like to present the information to the user for 
further selection. He can choose which articles to process and save.

My application is not a news reader, but it is some kind of retrieval 
program for fetching recipes from a cooking newsgroup.

Best regards,

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message