flat assembler
Message board for the users of flat assembler.

Index > Main > Profiling

Goto page Previous  1, 2
Thread Post new topic Reply to topic

Joined: 02 Dec 2012
Posts: 1178
Location: Unknown
HaHaAnonymous 13 Feb 2013, 23:43
[ Post removed by author. ]

Last edited by HaHaAnonymous on 28 Feb 2015, 21:30; edited 1 time in total
Post 13 Feb 2013, 23:43
View user's profile Send private message Reply with quote

Joined: 03 Dec 2011
Posts: 155
Location: Poland
randall 12 Mar 2013, 11:20
Very nice project:

Lightweight performance tools for Linux


likwid-perfctr : A tool to measure hardware performance counters on recent Intel and AMD processors. It can be used as wrapper application without modifying the profiled code or with a marker API to measure only parts of the code.
Post 12 Mar 2013, 11:20
View user's profile Send private message Visit poster's website Reply with quote

Joined: 24 Jun 2004
Posts: 20
prino 15 Mar 2013, 19:13
Program optimization, with
Donald Knuth wrote:
"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil"

A little example:

The old IBM OS PL/I compiler on z/OS has an option to count how many times each statement is executed. I still have a version of one of my programs, and the total statement count comes to 1,257,761,317, with one single procedure accounting for 1,238,974,804 of those executed statements (98.50%)

The current version of the program, which has rather a lot more functionality, has a rather nicer executed number of statements count of 14,778,811 (a reduction of 98.82%), and the nasty procedure, using a completely different algorithm executes just 110,204 statements (a reduction of more than 99.99%)

Obviously, this being a compiler and not an assembler, some statements result in calling library routines, but it makes patently clear that selecting the right algorithm has far more influence than anything else!

As for the
        cmp     [wmsg],WM_CREATE
        je      wmcreate
        cmp     [wmsg],WM_COPYDATA
        je      wmcopydata
        cmp     [wmsg],WM_GETMINMAXINFO
        je      wmgetminmaxinfo
        cmp     [wmsg],WM_SIZE
        je      wmsize
        cmp     [wmsg],WM_SETFOCUS
        je      wmsetfocus
        cmp     [wmsg],FM_NEW
        je      fmnew
        cmp     [wmsg],FM_OPEN
        je      fmopen
        cmp     [wmsg],FM_SAVE
        je      fmsave
        cmp     [wmsg],FM_COMPILE
        je      fmcompile
        cmp     [wmsg],FM_SELECT
        je      fmselect
        cmp     [wmsg],FM_ASSIGN
        je      fmassign
        cmp     [wmsg],FM_GETSELECTED
        je      fmgetselected
        cmp     [wmsg],FM_GETASSIGNED
        je      fmgetassigned
        cmp     [wmsg],FM_GETHANDLE
        je      fmgethandle
        cmp     [wmsg],WM_INITMENU
        je      wminitmenu
        cmp     [wmsg],WM_COMMAND
        je      wmcommand
        cmp     [wmsg],WM_NOTIFY
        je      wmnotify
        cmp     [wmsg],WM_DROPFILES
        je      wmdropfiles
        cmp     [wmsg],WM_CLOSE
        je      wmclose
        cmp     [wmsg],WM_DESTROY
        je      wmdestroy    

earlier in this thread, WM_CLOSE and WM_DESTROY were apparently put at the bottom, but did anyone actually bother to temporarily add counts to all other compares and order them in an descending order? For example, I would expect that an IDE would use FM_COMPILE rather a lot more than FM_NEW...

Robert AH Prins
robert dot ah dot prins at the big account from Google Wink
Post 15 Mar 2013, 19:13
View user's profile Send private message Visit poster's website Reply with quote

Joined: 19 Mar 2008
Posts: 1651
baldr 15 Mar 2013, 21:24

DEK hardly can be wrong, you know. How about adaptive program? It collects statistics about messages' frequences and rearranges (binary/AVL/B+/etc. tree) decision making code each time it runs. That's what those MS Office XP/2003 menus are all about.
Post 15 Mar 2013, 21:24
View user's profile Send private message 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.