flat assembler
Message board for the users of flat assembler.

Index > Windows > Performance Profiling

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo
This is because Maverick wants to discount the size of ret
Post 29 Jun 2004, 18:04
View user's profile Send private message Yahoo Messenger Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2140
Location: Estonia
Madis731
No, it's not that! I've tried everything and got timings like 32cycles per instruction for general registers!!!
You can get real timings when you push all your registers *changed* in the code.
i.e. add ebx,0 took me 1 cycle; add ebx,1 and others that change ebx took 32 cycles.
I came to a final code like:
Code:
push eax ebx ecx edx
nop
nop ;changed it to "dw 9090h" to fit on one line:D
;Your code here (I have a PIII)
add eax,ebx                  ;1.micro-op 1.cycle
add edx,eax                  ;2.micro-op 1.cycle
lea ecx,[eax*8+ebx+5] ;whole new cycle but no AGI Confused 
;2cycles Very Happy and i.e. 3 nop's take one cycle
;end
;Remember to subtract overhead from displayed result
pop edx ecx ebx eax
    
Post 30 Jun 2004, 09:21
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
I use these macros to get a cycle count in edx:eax, simply sandwhich you code between the STARTTIMER, and STOPTIMER macros and printout the result with whatever you use to printout results. And don't forget to run it empty and subtract the result from the main result.
MadMatt

macro STARTTIMER
{
push ecx
push ebx
rdtsc
push edx
push eax
}

macro STOPTIMER ;edx:eax = cpu cycles ellapsed
{
rdtsc
pop ebx
pop ecx
clc
sbb eax,ebx
sbb edx,ecx
pop ebx
pop ecx
}
Post 30 Jun 2004, 10:08
View user's profile Send private message Reply with quote
scientica
Retired moderator


Joined: 16 Jun 2003
Posts: 689
Location: Linköping, Sweden
scientica
madmatt, nice work Smile
Post 30 Jun 2004, 12:07
View user's profile Send private message Visit poster's website Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo
Very nice, Thanks
Post 30 Jun 2004, 12:42
View user's profile Send private message Yahoo Messenger Reply with quote
S.T.A.S.



Joined: 09 Jan 2004
Posts: 173
Location: Ru#27
S.T.A.S.
If you have AMD processor, you could try free AMD CodeAnalist Performance Analyser tool - it allows CPU pipeline analysis and many other things. It requires debug information in PBD file to run, please take look at this thread for information how to build it.
Post 22 Aug 2004, 10:22
View user's profile Send private message Reply with quote
Ralph



Joined: 04 Oct 2003
Posts: 86
Ralph
Hey,

Just a few more things I didn't see here:

rdtsc is not a serializing instruction (it doesn't sync the instructions currently executing out of order) so you should prefix it with an instruction that does such as cpuid. You can also do a 'warmup' to make sure the cache works in your favour by executing a few cpuid/rdtsc first.

Also, time slicing will probably interfere with your code. You can write a quick driver that will cli first to prevent this, or keep your code small, execute it a few times and take the lowest result.
Post 26 Aug 2004, 06:55
View user's profile Send private message Reply with quote
dap



Joined: 01 Dec 2007
Posts: 61
Location: Belgium
dap

_________________
(French only) http://dap.developpez.com
Post 09 Dec 2007, 22:42
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.