Author |
Message |
|
tyskis
Member
Joined: 20 Nov 2003 Posts: 238
|
Posted: 17 Mar 2004 03:23:53 am Post subject: |
|
|
Quote: Who used output?
Adm.Wiggin wrote: or, just put ANY Output( command last, and it is dead... :lol:
(hey, at least we are on topic right? )
He did, a long time ago
Last edited by Guest on 17 Mar 2004 03:24:23 am; edited 1 time in total |
|
Back to top |
|
|
Adm.Wiggin aka Tianon
Know-It-All
Joined: 02 Jun 2003 Posts: 1874
|
Posted: 17 Mar 2004 05:24:35 pm Post subject: |
|
|
Jedd wrote: This test is a shock to me. Did you guys know it was slower??? Then again, the second program probably goes faster in some situations, like Sir Robin said with "If AB" rather than "If A and B".
Well DUH! lol, jk...
it is slower because the parser has to check more code... the less code, the faster.
if you leave off closing parenthesis/quotation marks/etc., then it should be faster, because there is less code! |
|
Back to top |
|
|
X1011 10100111001
Active Member
Joined: 14 Nov 2003 Posts: 657
|
Posted: 17 Mar 2004 10:28:56 pm Post subject: |
|
|
Adm.Wiggin wrote: if you leave off closing parenthesis/quotation marks/etc., then it should be faster, because there is less code!
He did, as did I, and it was slower. |
|
Back to top |
|
|
Fr0sty
Member
Joined: 27 Nov 2003 Posts: 202
|
Posted: 17 Mar 2004 11:10:11 pm Post subject: |
|
|
There IS less code though. "(" and ")" are considered two different (tokens?) while "and" is one. |
|
Back to top |
|
|
Arcane Wizard `semi-hippie`
Super Elite (Last Title)
Joined: 02 Jun 2003 Posts: 8993
|
Posted: 18 Mar 2004 09:23:45 am Post subject: |
|
|
It's slower because the parser still has to add them in the end. Kind of like how If..Then..End is faster than If. |
|
Back to top |
|
|
Jedd 1980 Pong World Champion
Elite
Joined: 18 Nov 2003 Posts: 823
|
Posted: 18 Mar 2004 05:57:07 pm Post subject: |
|
|
Quote: There IS less code though. "(" and ")" are considered two different (tokens?) while "and" is one.
Instead of tokens you can say bytes or characters. What are tokens, anyway?
I guess there is no real universal law that more or less code is faster or slower. It all depends on the situation. Like "If Then Statement End" is faster than "If Statement", but For( is faster than For(). Very odd.
I mentioned this back in the CC topic a while ago. Somebody ought to make the ultimate reference for Basic programmers to see what is faster in their situation. This is a project that I've been considering for a while, and is a great group project, since everyone can add their bits and peices.
For example, we all know that PxlOn is faster than PtOn. And that PxlOn is faster than Line() (obviously). But when does it change that Line goes faster than PxlOn? What if I want to turn on 3 pixels? Should I use PxlOn or Line?
You get the idea. If anyone wants to work on this with me, please let me know. |
|
Back to top |
|
|
Ray Kremer
Member
Joined: 16 Feb 2004 Posts: 237
|
Posted: 18 Mar 2004 08:07:37 pm Post subject: |
|
|
Jedd wrote: What are tokens, anyway?
This should explain it. |
|
Back to top |
|
|
DarkerLine ceci n'est pas une |
Super Elite (Last Title)
Joined: 04 Nov 2003 Posts: 8328
|
Posted: 19 Mar 2004 05:17:15 pm Post subject: |
|
|
Jedd wrote: Somebody ought to make the ultimate reference for Basic programmers to see what is faster in their situation. This is a project that I've been considering for a while, and is a great group project, since everyone can add their bits and peices.
For example, we all know that PxlOn is faster than PtOn. And that PxlOn is faster than Line() (obviously). But when does it change that Line goes faster than PxlOn? What if I want to turn on 3 pixels? Should I use PxlOn or Line?
You get the idea. If anyone wants to work on this with me, please let me know.
In order to do this properly, you'd have to disassemble the TIOS code and count the cycles needed to run each function. It would take a lot of time. |
|
Back to top |
|
|
X1011 10100111001
Active Member
Joined: 14 Nov 2003 Posts: 657
|
Posted: 20 Mar 2004 05:11:18 pm Post subject: |
|
|
Sir Robin wrote: In order to do this properly, you'd have to disassemble the TIOS code and count the cycles needed to run each function. It would take a lot of time.
We could just get a couple of people to time a standard test of different functions and average the results. |
|
Back to top |
|
|
Jedd 1980 Pong World Champion
Elite
Joined: 18 Nov 2003 Posts: 823
|
Posted: 20 Mar 2004 05:23:09 pm Post subject: |
|
|
Quote: We could just get a couple of people to time a standard test of different functions and average the results
Exactly. Here's my idea: think of everything you can that someone might be unsure about which is faster, then take all of those and compare them in a For( loop from 1-1000 or something, and come up with exact times and percentages to make a table of comparisons with. Then catagorize them based on type of function. It would help a lot of Basic programmers decide which function to use in their situation. Tell me if you want to help out, I'm going to get started pretty soon. I'll put this on my website or computer or something. Other people can catagorize it differently if they like, too. |
|
Back to top |
|
|
X1011 10100111001
Active Member
Joined: 14 Nov 2003 Posts: 657
|
Posted: 21 Mar 2004 11:45:06 am Post subject: |
|
|
Ok, should we make a separate topic? We should make sure we have the same testing program, the same number of loops, and the same lines of code to test. |
|
Back to top |
|
|
DarkerLine ceci n'est pas une |
Super Elite (Last Title)
Joined: 04 Nov 2003 Posts: 8328
|
Posted: 21 Mar 2004 01:11:50 pm Post subject: |
|
|
X1011 wrote: We could just get a couple of people to time a standard test of different functions and average the results.
That might provide inaccurate results.
Edit: and some functions, like SortA(, take various amounts of time depending on the input.
Last edited by Guest on 21 Mar 2004 01:13:53 pm; edited 1 time in total |
|
Back to top |
|
|
X1011 10100111001
Active Member
Joined: 14 Nov 2003 Posts: 657
|
Posted: 21 Mar 2004 08:10:26 pm Post subject: |
|
|
Sir Robin wrote: That might provide inaccurate results.
It should be accurate enough if we do the loop enough times.
Quote: Edit: and some functions, like SortA(, take various amounts of time depending on the input.
We would have the same input. |
|
Back to top |
|
|
DarkerLine ceci n'est pas une |
Super Elite (Last Title)
Joined: 04 Nov 2003 Posts: 8328
|
Posted: 22 Mar 2004 05:14:50 pm Post subject: |
|
|
X1011 wrote: We would have the same input.
Exactly. So maybe when the numbers are less than 50, iPart is faster than int(, otherwise it is slower (I'm just making this up, probably not true).
Edit: what I'm trying to say is that maybe a function is faster than another for some but not all inputs which you would never find out.
Last edited by Guest on 22 Mar 2004 05:16:08 pm; edited 1 time in total |
|
Back to top |
|
|
Arcane Wizard `semi-hippie`
Super Elite (Last Title)
Joined: 02 Jun 2003 Posts: 8993
|
Posted: 23 Mar 2004 11:20:26 am Post subject: |
|
|
And if you just took a look at the source of the basic functions you can calculate how many CCs everything takes. |
|
Back to top |
|
|
DarkerLine ceci n'est pas une |
Super Elite (Last Title)
Joined: 04 Nov 2003 Posts: 8328
|
Posted: 23 Mar 2004 06:22:26 pm Post subject: |
|
|
Which would also take a long time. Shade( takes several seconds, just how many CC's is that?
Samoa basic tricks: some zooms, Shade, and ClrDraw change X and Y (set one/both to 0) |
|
Back to top |
|
|
Missin2rideWS
Newbie
Joined: 26 Mar 2004 Posts: 36
|
Posted: 05 Apr 2004 07:00:15 pm Post subject: |
|
|
Flash wrote: tell me when you get done with it... i cant get my asm to hexdecimal thing working (or ever did) so that os would be nice
just made one of those.... like 10 minits ago
what r u havin trouble with |
|
Back to top |
|
|
Darth Android DragonOS Dev Team
Bandwidth Hog
Joined: 31 May 2003 Posts: 2104
|
Posted: 08 Apr 2004 01:15:51 pm Post subject: |
|
|
ok! new undocumented trick that i discovered! any tell me if you knew about this prior to this post!
when storing to a custom list, you dont need the L!
{1,2->A
is the same as
{1,2->LA |
|
Back to top |
|
|
X1011 10100111001
Active Member
Joined: 14 Nov 2003 Posts: 657
|
Posted: 08 Apr 2004 02:18:40 pm Post subject: |
|
|
Yea, i knew that. |
|
Back to top |
|
|
Brazucs I have no idea what my avatar is.
Super Elite (Last Title)
Joined: 31 Mar 2004 Posts: 3349
|
Posted: 17 Apr 2004 05:04:58 pm Post subject: |
|
|
It's not really a BASIC trick, but it's awesome.
clicka-de-doo-da
Sir Robin wrote: It does, thank you.
I used this:
:" (16 spaces go here) "
:Text(-1,0,0,Ans
:Text(-1,8,0,Ans
...
:Text(-1,56,0,Ans
to clear the screen. It is not much slower, does not clear X and Y, and creates a cool looking effect.
This is waay to late, but since this is pinned, here it goes:
Code: :" (16 spaces go here) "
:For(A,0,56,8
:Text(-1,A,0,Ans
:End
That way is much better
Last edited by Guest on 21 May 2004 12:24:09 am; edited 1 time in total |
|
Back to top |
|
|
|