Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Brun45.exe and Dll
#21
I wrote a lib to do extremely fast console i/o in windows. search fb forum for conlib, if you want it. makes screen 0 just like a graphics mode, supports get/put.

http://www.freebasic.net/forum/viewtopic.php?t=3862
Reply
#22
Quote:
Code:
CLS
starts = TIMER
FOR i = 1 TO 1000000
    FOR j = 1 TO 10000
    NEXT j
NEXT i
stops = TIMER
PRINT stops - starts
WHILE INKEY$ = "": WEND
Did someone notice if that code is run like this in QB the variables will be SINGLE and they will be integer in FB? That explains the difference IMHO...

And for the tests involving PRINT, I guess the comparison is run fullscreen. If not, you are measuring the speed of the windows console...
Antoni
Reply
#23
O.K., at the start of the program, I added
DEFINT I,J
Then, I had to change it, since the first value, 100000 was greater than the largest integer that QB allows, 32,000+. The new program is:
Code:
DEFINT I-J
CLS
starts = TIMER*1000
FOR i = 1 TO 10000
  FOR j = 1 TO 30000
  NEXT j
NEXT i
stops = TIMER*1000
PRINT stops - starts
WHILE INKEY$ = "": WEND
I ran it in QB, getting 3.3 secs
In fb, it gave 0.98 secs, or, approximatel, 3.4 times faster than QB.

By the way, Antoni, I ran both programs in windows and in full screens, with no difference in the times. And, from what RyanKelly said above, I am not sure that, other than getting a relative time between whatever, I am not getting a proper, real time for the actual program run. However, when the program is running, I do a mental count of seconds, up to as many as 30 or so, and my manual count checks with the printout time from the program.
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply
#24
Quote:RyanKelly:
Just what is "running in DOS"? Does this mean that the operating system must be DOS?

More or less, yes. Current proccessors can be run in two different modes (well 3 sort of). DOS runs in what is referred to as real mode, which operates the way the old intel 8088 and 8086 chips did. Operating systems likes Windows and Linux switch the proccessor into "protected mode" to take advantage of proccess protection, paged and virtualized memory, certain context saving features for multitasking, and default 32 bit operation. Protected mode runs code designed for it well, but task changes are relatively slow. Old 16 bit DOS code can be run in protected mode in what is refered to as "virtual x86 mode" which allows an operating system to supervise the program (some old memory managers ran DOS in this way as well). The catch is that most IO instructions and software interrupts force a context switch to the operating system so that it can "emulate" the hardware, so when you run DOS programs in Windows their performance in severely degraded.
Reply
#25
Quote:I wrote a lib to do extremely fast console i/o in windows.
nope, Ihmo those virtues need to be built-in in the FBC or FBide.
Reply
#26
Peopel want small exe's. That's why fb is not packed full of features. It could be, believe me. You want it in FB, write it yourself, or happen to have someone else do it, like I did with conLib
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)