Thread View: news.software.nntp
13 messages
13 total messages
Started by Jack
Wed, 04 Apr 2001 22:33
Download Speed
Author: Jack
Date: Wed, 04 Apr 2001 22:33
Date: Wed, 04 Apr 2001 22:33
65 lines
2867 bytes
2867 bytes
Is there any command that can be sent to news server that will make download
faster? (I think I tried something like "Mode Reader" but that didn't help).
If anyone knows java, the following code connects to news server and tries to
download the subjects of all the posts from a newsgroup called
"24hoursupport.helpdesk" .. I choose this newsgroup because it seems to have
lots of posts.
The problem is that the download speed of this code on my computer is less than
5K. But the regular newsreader can download headers from the same newsgroup with
the speed of between 30K to 50K.
Does anyone knows why the speed is different?
import java.io.*;
import java.net.*;
import java.util.StringTokenizer;
public class Test
{
public static void main(String[] args) throws Exception
{
Socket sock = new Socket("yournewsserver", 119);
BufferedReader in = new BufferedReader (new
InputStreamReader(sock.getInputStream()));
PrintWriter out = new PrintWriter(new BufferedWriter (new
OutputStreamWriter(sock.getOutputStream())),true);
System.out.println(in.readLine());
out.println("AUTHINFO USER " + "your_login");
System.out.println(in.readLine());
out.println("AUTHINFO PASS " + "your_password");
System.out.println(in.readLine());
out.println("GROUP " + "24hoursupport.helpdesk");
String temp = in.readLine();
System.out.println(temp);
StringTokenizer tok = new StringTokenizer(temp);
tok.nextToken();
tok.nextToken();
String begin = tok.nextToken();
String end = tok.nextToken();
out.println("XHDR " + "Subject " + begin + "-" + end);
while (true)
{
temp = in.readLine();
System.out.println(temp);
if (temp.equals("."))
break;
}
out.println("QUIT");
}
}
Re: Download Speed
Author: those who know me have no need o...
Date: Thu, 05 Apr 2001 01:06
Date: Thu, 05 Apr 2001 01:06
22 lines
1250 bytes
1250 bytes
<b88nct86r5onui9qjoaaj8pak8uslkt2a0@4ax.com> divulged:
>Is there any command that can be sent to news server that will make
>download faster?
no.
>Does anyone knows why the speed is different?
java is slow.
>out.println("XHDR " + "Subject " + begin + "-" + end);
most newsreaders send an xover command, e.g., ``xover 1-''.
> System.out.println(temp);
doing this will certainly trash your performance.
--
okay, have a sig then
Re: Download Speed
Author: Jack
Date: Thu, 05 Apr 2001 06:48
Date: Thu, 05 Apr 2001 06:48
41 lines
2271 bytes
2271 bytes
On Thu, 05 Apr 2001 01:06:36 -0000, not-a-real-address@usa.net (those who know
me have no need of my name) wrote:
><b88nct86r5onui9qjoaaj8pak8uslkt2a0@4ax.com> divulged:
>
>>Is there any command that can be sent to news server that will make
>>download faster?
>
>no.
>
>>Does anyone knows why the speed is different?
>
>java is slow.
Wrong answer. Even if Java were slow (I don't agree with that), it should not
have any effect on download speed in this case (internet is a LOT slower than
Java -- which isn't slow anyway).
>>out.println("XHDR " + "Subject " + begin + "-" + end);
>
>most newsreaders send an xover command, e.g., ``xover 1-''.
>
>> System.out.println(temp);
>
>doing this will certainly trash your performance.
Huh? I am reading a line and printing it to the screen (as opposed to saving it
on the disk).
If you don't know the answer, don't reply with cliches like "java is slow"
(yawn).
I think it's more likely that my news server responds slower to XHDR command
because it takes time to find "subject" from headers?
Anyone knows if that's true for all servers or is it just my server?
Re: Download Speed
Author: Russ Allbery
Date: Thu, 05 Apr 2001 07:33
Date: Thu, 05 Apr 2001 07:33
28 lines
2240 bytes
2240 bytes
Jack <jkt@home.net> writes:
> not-a-real-address@usa.net (those who know me have no need of my name) wrote:
>>> System.out.println(temp);
>> doing this will certainly trash your performance.
> Huh? I am reading a line and printing it to the screen (as opposed to
> saving it on the disk).
Printing to the screen is generally an order of magnitude slower than
writing to a file, which is slower still than caching the data in memory
(which is what most news readers do). The operations performed by the
system when a line is written to the screen are considerably more complex
than those performed when you write to a file on disk.
> I think it's more likely that my news server responds slower to XHDR
> command because it takes time to find "subject" from headers?
That shouldn't be the case, since that is a header required to be in
overview.
--
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
Please post questions rather than mailing me directly.
<http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Download Speed
Author: Curt Welch
Date: Thu, 05 Apr 2001 18:48
Date: Thu, 05 Apr 2001 18:48
50 lines
3062 bytes
3062 bytes
"Jack" <jkt@home.net> wrote:
> On Thu, 05 Apr 2001 01:06:36 -0000, not-a-real-address@usa.net (those who
> know me have no need of my name) wrote:
> >java is slow.
>
> Wrong answer. Even if Java were slow (I don't agree with that), it should
> not have any effect on download speed in this case (internet is a LOT
> slower than Java -- which isn't slow anyway).
Java isn't as fast as the internet. But that isn't your problem.
> >>out.println("XHDR " + "Subject " + begin + "-" + end);
> >
> >most newsreaders send an xover command, e.g., ``xover 1-''.
> >
> >> System.out.println(temp);
> >
> >doing this will certainly trash your performance.
>
> Huh? I am reading a line and printing it to the screen (as opposed to
> saving it on the disk).
Try printing lines in a loop and time just how fast it works. It's
not as fast as you seem to think it is. Do you know how many bytes
have to be moved around every time you scroll the screen? Think
about it.
Take the print out and see what happens to your speed. If you are
wondering why it's not going fast, that should have been the first
thing to go.
> I think it's more likely that my news server responds slower to XHDR
> command because it takes time to find "subject" from headers?
I do too. That would have been my first guess as well. But why
guess? Change the XHDR to an XOVER and test it.
> Anyone knows if that's true for all servers or is it just my server?
All servers have different performance characteristics. But XOVER is
what _everybody_ uses these days. XHDR is the older command that's not
used very much and is implemented mostly for backward compatibility
reasons. So if one is going to be faster than the other, it's likely that
XOVER will be the faster one.
--
Curt Welch http://CurtWelch.Com/
curt@kcwc.com Webmaster for http://NewsReader.Com/
Re: Download Speed
Author: Jack
Date: Thu, 05 Apr 2001 20:45
Date: Thu, 05 Apr 2001 20:45
53 lines
3220 bytes
3220 bytes
On 05 Apr 2001 18:48:42 GMT, curt@kcwc.com (Curt Welch) wrote:
>> >java is slow.
>>
>> Wrong answer. Even if Java were slow (I don't agree with that), it should
>> not have any effect on download speed in this case (internet is a LOT
>> slower than Java -- which isn't slow anyway).
>Java isn't as fast as the internet. But that isn't your problem.
"Slowness" of Java shouldn't have any effect on this. Plus Java isn't slow. See
benchmark compared to c++.
http://www.aceshardware.com/Spades/read.php?article_id=153
>> >>out.println("XHDR " + "Subject " + begin + "-" + end);
>> >
>> >most newsreaders send an xover command, e.g., ``xover 1-''.
>> >
>> >> System.out.println(temp);
>> >
>> >doing this will certainly trash your performance.
>>
>> Huh? I am reading a line and printing it to the screen (as opposed to
>> saving it on the disk).
>Try printing lines in a loop and time just how fast it works. It's
>not as fast as you seem to think it is. Do you know how many bytes
>have to be moved around every time you scroll the screen? Think
>about it.
Printing to screen is slow, but again it's a LOT faster than download speed
which is at best 200K on my connection. Printing shouldn't have any effect in
this case. Even if it did, it shouldn't have dropped the speed from 30K to 5K.
>I do too. That would have been my first guess as well. But why
>guess? Change the XHDR to an XOVER and test it.
XOVER is faster. But the string it sends would be much harder to parse. It sends
line like
67975 Re: Guaranteed-unique path element? Jeremy <jeremy@exit109.com>
28 Jan 2001 09:27:21 GMT <980674041.686436@news.netscum.dk> <slrn976
tl7.bkm.rich@bofh.concordia.ca> <yl4rykwhjt.fsf@windlord.stanford.edu> <slrn9772
22.enp.rich@bofh.concordia.ca> <ylzogctk5c.fsf@windlord.stanford.edu> 1117
11 Xref: cyclone.swbell.net news.software.nntp:67975
this is harder to parse than xhdr subject or xhdr date
Re: Download Speed
Author: Curt Welch
Date: Thu, 05 Apr 2001 22:17
Date: Thu, 05 Apr 2001 22:17
33 lines
2676 bytes
2676 bytes
"Jack" <jkt@home.net> wrote: > XOVER is faster. But the string it sends would be much harder to parse. Either you are a worthless programmer or you just don't know the format of an XOVER line. I'm guessing it's the second. So let me help you... Each field in the XOVER line is separated with a single TAB character. There are no TAB characters in the fields to deal with, If there were, they were changed to spaces by the news server (in the XOVER data only). (TAB=^I=Decimal 9=HEX 09=Octal 11= C string "\t"). To extract the headers from an XOVER line, all you have to do is scan though the string and find the TAB characters. The subject starts after the first TAB in the line and ends at the next. It really isn't much harder than parsing the XHDR output. The issue is that there's a lot more data sent to you it can take longer to download. When you said the newsreader was downloading at a higher rate, did you adjust for the fact that XOVER is sending a lot more data? i.e. does it take longer when using XHDR, or does it take about the same amount of time and the XOVER just causes the download rate in bytes/second to be higher? I.e. if you calculate article subjects downloaded per second, is xover really faster for your application? -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com Webmaster for http://NewsReader.Com/
Re: Download Speed
Author: those who know me have no need o...
Date: Fri, 06 Apr 2001 04:12
Date: Fri, 06 Apr 2001 04:12
22 lines
1775 bytes
1775 bytes
<7c4octsegmenh3aitknvml949s2c99i82a@4ax.com> divulged: >If you don't know the answer, don't reply with cliches like "java is slow" >(yawn). sorry bub. you got my answer, all of which i believe to be causal factors. you don't like that -- fine. >Anyone knows if that's true for all servers or is it just my server? if your server provides xhdr data slower than it does xover data then it would be a darned poor server, since both sets of data are usually obtained from the same source (the overview database). (fractionally slower can be accepted, due to potential changes in buffering and/or nagle effects. but that's it, "fractionally slower" not grossly slower as you have indicated.) it might be that your server has to retrieve each article and extract the header prior to sending it to you -- that would be piss poor server software. -- okay, have a sig then
Re: Download Speed
Author: J.B. Moreno
Date: Fri, 06 Apr 2001 04:32
Date: Fri, 06 Apr 2001 04:32
16 lines
1643 bytes
1643 bytes
In article <20010405144842.423$rg@newsreader.com>, Curt Welch <curt@kcwc.com> wrote: -snip- > All servers have different performance characteristics. But XOVER is > what _everybody_ uses these days. XHDR is the older command that's not > used very much and is implemented mostly for backward compatibility > reasons. So if one is going to be faster than the other, it's likely that > XOVER will be the faster one. And filtering on non-standard headers (Content-Type, X-Newsreaders, Newsgroups on servers that don't include it in the xref, X-Web-TV). -- J.B. Moreno
Re: Download Speed
Author: Jack
Date: Sat, 07 Apr 2001 08:37
Date: Sat, 07 Apr 2001 08:37
15 lines
1757 bytes
1757 bytes
On Thu, 05 Apr 2001 15:45:54 -0500, "Jack" <jkt@home.net> wrote: >67975 Re: Guaranteed-unique path element? Jeremy <jeremy@exit109.com> >28 Jan 2001 09:27:21 GMT <980674041.686436@news.netscum.dk> <slrn976 >tl7.bkm.rich@bofh.concordia.ca> <yl4rykwhjt.fsf@windlord.stanford.edu> <slrn9772 >22.enp.rich@bofh.concordia.ca> <ylzogctk5c.fsf@windlord.stanford.edu> 1117 >11 Xref: cyclone.swbell.net news.software.nntp:67975 In the above example, what's "1117" before 11?
Re: Download Speed
Author: Jeffrey M. Vinocur
Date: Sat, 07 Apr 2001 15:59
Date: Sat, 07 Apr 2001 15:59
42 lines
2325 bytes
2325 bytes
In article <aaktct430oftqn6lj8uasf8n1di5k66vjf@4ax.com>, Jack <jkt@home.net> wrote: >On Thu, 05 Apr 2001 15:45:54 -0500, "Jack" <jkt@home.net> wrote: > >>67975 Re: Guaranteed-unique path element? Jeremy <jeremy@exit109.com> >>28 Jan 2001 09:27:21 GMT <980674041.686436@news.netscum.dk> ><slrn976 >>tl7.bkm.rich@bofh.concordia.ca> <yl4rykwhjt.fsf@windlord.stanford.edu> ><slrn9772 >>22.enp.rich@bofh.concordia.ca> <ylzogctk5c.fsf@windlord.stanford.edu> 1117 >>11 Xref: cyclone.swbell.net news.software.nntp:67975 > > >In the above example, what's "1117" before 11? Number of bytes. Here's INN's default overview.fmt which gives the order: ---BEGIN--- ## $Revision: 1.3 $ ## overview.fmt - format of news overview database ## Format ## <header> ## <header>:full ## header is a news article header, known by innd. If ":full" appears, ## then header name will be prepended. Order of lines is important! Subject: From: Date: Message-ID: References: Bytes: Lines: Xref:full #Keywords:full ---END--- -- Jeffrey M. Vinocur jeff@litech.org
Re: Download Speed
Author: bill davidsen
Date: Tue, 10 Apr 2001 15:34
Date: Tue, 10 Apr 2001 15:34
42 lines
2694 bytes
2694 bytes
In article <7c4octsegmenh3aitknvml949s2c99i82a@4ax.com>,
Jack <jkt@home.net> wrote:
| Wrong answer. Even if Java were slow (I don't agree with that), it should not
| have any effect on download speed in this case (internet is a LOT slower than
| Java -- which isn't slow anyway).
If you don't want help, why ask?
| >>out.println("XHDR " + "Subject " + begin + "-" + end);
| >
| >most newsreaders send an xover command, e.g., ``xover 1-''.
| >
| >> System.out.println(temp);
| >
| >doing this will certainly trash your performance.
|
| Huh? I am reading a line and printing it to the screen (as opposed to saving it
| on the disk).
And this will do what when you increase the data volume by four times
or so?
| If you don't know the answer, don't reply with cliches like "java is slow"
| (yawn).
|
| I think it's more likely that my news server responds slower to XHDR command
| because it takes time to find "subject" from headers?
|
| Anyone knows if that's true for all servers or is it just my server?
Since you haven't told us what kind of connection you have to the
server, it's not possible to guess if the slower response from XHDR
hurts more than the 4x or so increase in bytes and the CPU to parse the
subject out of the data. But then your java isn't slow like most
people's, which are 2-4 times slower than c/c++.
--
bill davidsen <davidsen@tmr.com> CTO, TMR Associates, Inc
"I am lost. I am out looking for myself. If I should come back before I
return, please ask me to wait." -seen in a doctor's office
Re: Download Speed
Author: Jack
Date: Sat, 14 Apr 2001 19:27
Date: Sat, 14 Apr 2001 19:27
15 lines
1746 bytes
1746 bytes
On 10 Apr 2001 15:34:42 GMT, davidsen@tmr.com (bill davidsen) wrote: >But then your java isn't slow like most >people's, which are 2-4 times slower than c/c++. Java is not slow compared to c++, at least according to these benchmarks http://www.aceshardware.com/Spades/read.php?article_id=153 The problem is the news server. XOVER is faster than XHDR, much faster, even on the "slow" java. XOVER was able to send headers quicker than XHDR (despite the fact that XOVER sends more data compared to XHDR subject).
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads