Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 13:20 21 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Good ol' Windoze, doing its thing...(MMB4W)

Author Message
Tinine
Guru

Joined: 30/03/2016
Location: United Kingdom
Posts: 1646
Posted: 01:36pm 22 Aug 2022
Copy link to clipboard 
Print this post





Although, curiously, when I test the same routine in QBjs, the result is consistently 2.0000000ms and the only flyer was something like 2.999999ms

Craig
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4147
Posted: 02:09pm 22 Aug 2022
Copy link to clipboard 
Print this post

Give us a clue with what the program is!

John
 
Tinine
Guru

Joined: 30/03/2016
Location: United Kingdom
Posts: 1646
Posted: 02:20pm 22 Aug 2022
Copy link to clipboard 
Print this post

I was just testing the CAT function again. The manual states that it's faster but at least the way I'm using it, this is not the case:


a$=chr$(170)
b$=a$
c$=a$
d$=a$
e$=a$

timer=0
for i = 1 to 1000
a$=a$+b$+c$+d$+e$
a$=chr$(170)
next
print timer

timer=0
for i = 1 to 1000
cat a$,b$
cat a$,c$
cat a$,d$
cat a$,e$
a$=chr$(170)
next
print timer
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10628
Posted: 03:00pm 22 Aug 2022
Copy link to clipboard 
Print this post

  Quote   The manual states that it's faster but at least the way I'm using it, this is not the case:


The increased speed is a function of the number of variable lookups in a single statement. In your code there are 6 in the first version and 8 in the second and 1 statement in the first and 4 in the second hence it is slower in your usage.

Compare the simple case

inc a$,b$

vs

[LET] a$=A$+b$

where it is 2 vs 3 hence quicker
Edited 2022-08-23 01:01 by matherp
 
Tinine
Guru

Joined: 30/03/2016
Location: United Kingdom
Posts: 1646
Posted: 03:26pm 22 Aug 2022
Copy link to clipboard 
Print this post

Makes sense, Pete because on the more consistent Pico, the 6:8 ratio is pretty much what I get.

Of course, I had to try

cat a$,b$,c$,d$,e$


In the hope that the manual was wrong  

Craig
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025