1. RE: What's Faster?
- Posted by Al Getz <Xaxo at aol.com> Jun 14, 2003
- 448 views
Derek Parnell wrote: > > > ----- Original Message ----- > From: "Al Getz" <Xaxo at aol.com> > To: "EUforum" <EUforum at topica.com> > Subject: What's Faster? > > > > Hello, > > > > What is faster during initialization: > > > > > > constant A1=#F > > > > or > > > > constant A1=15 > > > > In other words, does the interpreter read hex numbers > > faster then whole decimal integer numbers? > > And what about whole numbers between max_integer and #FFFFFFFF ? > > If there is any speed differences, it would be measured in microseconds > and > as constants only get initialized once in an application, you would not > really be able to detect the difference. In short, it isn't worth the > time > to worry about it. > > > > > Also, > > > > MySeq[5]=1 > > > > or > > > > MySeq[THE_NUMBER_FIVE]=1 > > > > > > This last one doesnt have to include the time it took > > to load the constant THE_NUMBER_FIVE. > > > > In other words, is it faster to read a number typed > > within the sequence bracket or is it faster to read > > the name of the constant, assuming at least 10 characters > > in the constants' name? > > Similar story here too. The speed up for using literals rather than > constants is also measured in microseconds. So unless you are doing this > operation many millions of times over, the loss in readability is not > worth > the effort. > > -- > Derek > > Hello, Thanks for the reply, but... The reason i asked the question: "What is faster" is because i wanted to know exactly that; 'what is faster'. Of course i dont mind if there is a slight difference when using this ONE time, but, as you could have guessed, i want to apply the answer to maybe 50,000 such cases in the same program. In this case: 50,000 times 10us equals 0.5 second difference in loading time, if in fact it is 10us, but if it's 1us THEN it doesnt matter. Since i have control over which way to do it, im not going to choose the longer time if i can help it, even if it's only 0.25 seconds instead of 0.5 seconds. It would also be nice to know the ratio, like 1.1 to 1, or 1.001 to 1. Any ideas? Al
2. RE: What's Faster?
- Posted by Al Getz <Xaxo at aol.com> Jun 14, 2003
- 435 views
Derek Parnell wrote: > > On my machine (Pentium 3, 550MHz) the symbol version took > >3.1417215866e-8 or > 0.0314 microseconds, and the literal version took 3.152719912e-8 or > >0.0315 > microseconds. So the speed difference is about 0.0001 microseconds. > >Taking > your 50,000 cases that works out to be a massive 5 microseconds. > >Personally, > I can't see the user giving a damn. > > -- > Derek > I cant either, but then that's why i asked. People ask questions to get answers. I feel better now, not only because i got the answer, but because i got the answer AND it only took two posts (And i didnt feel like testing it out myself). I also noticed that the latest-1 version of Winlib was a little slow loading, so i was trying to find ways of increasing load speed of my own programs (in exw form). I had to create an example demo for my 'Display Server' posted recently, so i ended up playing around with the newer version a little. It takes quite a bit longer to load then i expected even for the small demo i wrote. On the plus side, once it's bound it loads faster. Take care for now, Al
3. RE: What's Faster?
- Posted by rforno at tutopia.com Jun 15, 2003
- 450 views
Yes. Test it by creating (by means of an editor or another EU program) a pair of huge EU programs each using one of the opposed methods. Regards. ----- Original Message ----- From: Al Getz <Xaxo at aol.com> Subject: RE: What's Faster? > > > Derek Parnell wrote: > > > > > > ----- Original Message ----- > > From: "Al Getz" <Xaxo at aol.com> > > To: "EUforum" <EUforum at topica.com> > > Sent: Sunday, June 15, 2003 2:53 AM > > Subject: What's Faster? > > > > > > > Hello, > > > > > > What is faster during initialization: > > > > > > > > > constant A1=#F > > > > > > or > > > > > > constant A1=15 > > > > > > In other words, does the interpreter read hex numbers > > > faster then whole decimal integer numbers? > > > And what about whole numbers between max_integer and #FFFFFFFF ? > > > > If there is any speed differences, it would be measured in microseconds > > and > > as constants only get initialized once in an application, you would not > > really be able to detect the difference. In short, it isn't worth the > > time > > to worry about it. > > > > > > > > Also, > > > > > > MySeq[5]=1 > > > > > > or > > > > > > MySeq[THE_NUMBER_FIVE]=1 > > > > > > > > > This last one doesnt have to include the time it took > > > to load the constant THE_NUMBER_FIVE. > > > > > > In other words, is it faster to read a number typed > > > within the sequence bracket or is it faster to read > > > the name of the constant, assuming at least 10 characters > > > in the constants' name? > > > > Similar story here too. The speed up for using literals rather than > > constants is also measured in microseconds. So unless you are doing this > > operation many millions of times over, the loss in readability is not > > worth > > the effort. > > > > -- > > Derek > > > > > Hello, > > Thanks for the reply, but... > > The reason i asked the question: > > "What is faster" > > is because i wanted to know exactly that; > 'what is faster'. > > Of course i dont mind if there is a slight difference > when using this ONE time, but, as you could have guessed, > i want to apply the answer to maybe 50,000 such cases > in the same program. > > In this case: > > 50,000 times 10us equals 0.5 second difference in loading time, > if in fact it is 10us, but if it's 1us THEN it doesnt matter. > Since i have control over which way to do it, im not going > to choose the longer time if i can help it, even if it's only > 0.25 seconds instead of 0.5 seconds. > > It would also be nice to know the ratio, like > 1.1 to 1, or 1.001 to 1. > > > Any ideas? > > Al > > > > TOPICA - Start your own email discussion group. FREE! > >
4. RE: What's Faster?
- Posted by Al Getz <Xaxo at aol.com> Jun 15, 2003
- 430 views
rforno at tutopia.com wrote: > > > Yes. > Test it by creating (by means of an editor or another EU program) a pair > of > huge EU programs each using one of the opposed methods. > Regards. Yes, you're right, i should have tested it myself, but i thought it would be a good idea to ask here for the benefit of others as well. I do appreciate the answers and the interest others have in the language, even though sometimes i might not sound like it Take care for now, Al