Ha,Darrel may recognize some of his tricks
I knew that stuff would come in handy some day.
Nice comparisons.
<br>
Ha,Darrel may recognize some of his tricks
I knew that stuff would come in handy some day.
Nice comparisons.
<br>
DT
Thanks for sharing those figures with us Steve. Repeat is the same as a conditional (DO Loop) ? Main reason DO's are faster is because unlike For Nexts, they don't have counters. In VB, (For Nexts) are idiot proof making them relatively bloated & slow.
<br/>
Last edited by T.Jackson; - 28th May 2007 at 01:23.
Yes indeed.
mmm yes and no. Here what reduce the speed is more likely the .0[Temp] stuff. Let's seeMain reason DO's are faster is because unlike For Nexts, they don't have counters.
Code:@ SIZESTART for temp = 0 to 7 next temp @ SIZEEND "FOR-TO-NEXT" @ SIZESTART temp = 0 repeat temp=temp+1 until temp = 8 @ SIZEEND "REPEAT - UNTIL"about the same code space, 41uSec of difference in the speed for the whole thing.
FOR-TO-NEXT: 13 WORDS, 113 UsEC
REPEAT - UNTIL: 9 WORDS, 72 UsEC
But now, have a look at this
Code:@ SIZESTART Summe_Alarm.0 = 0 @ SIZEEND "Direct Bit Addressing" @ SIZESTART temp = 0 summe_Alarm.0[temp] = 0 @ SIZEEND ".0[Temp] stuff"
Direct Byte Addressing: 1 WORDS, 1 UsEC
.0[Temp] stuff: 10 WORDS, 47 UsECThat's 46 uSec BY single instructions/lines like that. So... much revealant when you use them a loop that the loop itself.
Last edited by mister_e; - 28th May 2007 at 04:56.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
yup, kinda REALLY handy stuff. I use it a lot here in a custom INCLUDE FILE! YES you heard me, STEVE USE INCLUDE FILES NOW
(refer to those http://www.picbasic.co.uk/forum/showthread.php?t=2108 and http://www.picbasic.co.uk/forum/showthread.php?t=2400 )
So it's a kind of personal mix of old and pretty old previous thread
Those wanting to know where the idea came from, i think those bellow are the main resources
- Embedded Strings in your Code Space
- While we're on the subject of optimization...
- The EXT (external) modifier.
- How much code would a code hog hog
- instruction execution time
See what you have done with me !
Last edited by mister_e; - 28th May 2007 at 04:07.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
When used with FOR NEXT or any of the others, this should further cut time and code space .....Code:IF (ml_value[temp]-$5B)<$27 THEN Summe_alarm.0[temp]=0 ELSE summe_alarm.0[temp]=1 ENDIF
ASM anyone?
Paul Borgmeier
Salt Lake City, UT
USA
__________________
Worth to measure it... do we need to start a 'coding challenge' here... if so, i'll warn Darrel, he like that![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Last edited by paul borgmeier; - 28th May 2007 at 05:23. Reason: added more detail
Paul Borgmeier
Salt Lake City, UT
USA
__________________
Yes but first, we have to get rid of the .0[temp] for speed (see previous post).
i'm thinking of some kind of aliasing... but, i keep thinking...
Yeah, it's getting interesting![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks