News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

why console subsystem slower

Started by thomas_remkus, July 31, 2009, 07:13:31 PM

Previous topic - Next topic

thomas_remkus

redskull:
I'm working from 'quesstimations' because I don't have any timing code. The "AllocConsole" is interesting so I'll try that.

hutch:
I'll put the keypress in there and see how that works. Uh, "chalk and cheese" ... fantastic. I think what you are saying is that once the console portion is loaded all the other code should run with the same performance.

dedndave

#16
MichaelW wrote the timing macros we use
they are available in the first post of the first thread of the Laboratory sub-forum

        INCLUDE \masm32\include\masm32rt.inc
        .686
        INCLUDE \masm32\macros\timers.asm

notice that .686 is needed prior to the timers (i think 586 works, too)

you need to define a loop count
once you get the program running, try to adjust it so the loop test takes roughly 1/2 second (usually gives repeatable readings)

LOOP_COUNT = 100000

it is a good idea to restrict execution to a single core - this works on single-core and multi-core machines

        INVOKE  GetCurrentProcess
        INVOKE  SetProcessAffinityMask,eax,1

use HIGH_PRIORITY_CLASS for most testing
when it is done, the EAX register holds the cycle count

        counter_begin LOOP_COUNT,HIGH_PRIORITY_CLASS

; place your test code here

        counter_end

        print   str$(eax),9,"clock cycles",13,10