pb-event-fast

Share your advanced PureBasic knowledge/code with the community.
User avatar
gurj
Enthusiast
Enthusiast
Posts: 693
Joined: Thu Jan 22, 2009 3:48 am
Location: china
Contact:

Re: pb-event-fast

Post by gurj »

@Little John:
thanks!
haha, :(

when debugger is off,
and change:
Debug b
Debug ElapsedMilliseconds()-q
to:
q=ElapsedMilliseconds()-q
MessageRequester("",""+b+~"\n"+q)

use virtual tables out:
b;my pc =-5
ElapsedMilliseconds()-q;my pc =342

use Select out:
b;my pc =-155
ElapsedMilliseconds()-q;my pc =174

@GedB:
thanks! :mrgreen:
You are like a teacher to guide students to progress, thank you again for your link !
my pb for chinese:
http://ataorj.ys168.com
User avatar
gurj
Enthusiast
Enthusiast
Posts: 693
Joined: Thu Jan 22, 2009 3:48 am
Location: china
Contact:

Re: pb-event-fast

Post by gurj »

I have just experimented a few times and found that:
Sometimes the virtual table is fast, sometimes the Select is fast, and the data changes relatively large, unstable.

Updated.

Change
eg=Random(20,1)
mi=Random(10,1)
to:
eg+1;=Random(20,1)
If eg>20
eg=1:EndIf

mi+1;=Random(10,1)
If mi>10
mi=1:EndIf

It's stable now, it's virtual table fast.:
virtual tables out:
b=2 time=144

Select out:
b=2 time=174
my pb for chinese:
http://ataorj.ys168.com
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: pb-event-fast

Post by Fred »

Seems to work as expected in current release, can anybody else confirm ?
User avatar
mk-soft
Always Here
Always Here
Posts: 6207
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: pb-event-fast

Post by mk-soft »

[22:03:26] [COMPILER] Line 51: EnableASM and DisableASM are not supported with C backend.
macOS :mrgreen:

With Windows (ASM) works

Everything works with my virtual table for the event procedures (My Event Designer)
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
SMaag
Enthusiast
Enthusiast
Posts: 303
Joined: Sat Jan 14, 2023 6:55 pm
Location: Bavaria/Germany

Re: pb-event-fast

Post by SMaag »

This trick with Protoype and Invoke from mk-soft is new for me! Tank's.
To make a direct call over a Structure is a thing what you have to see.
I never had the idea to do it like that

Code: Select all

Prototype MyProtoInvoke()

Structure udtCallEvent
  Invoke.MyProtoInvoke[0]
EndStructure

*CallEventMenu\Invoke[MenuID]()
Post Reply