Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Moderator Dave2001's Avatar
    Join Date
    Dec 2001
    Location
    USA
    Posts
    310

    Profiling a plugin?

    A while back Doom told me about this way of finding slow parts of code, called "profiling". I had never done this before. So, I went & checked "enable profiling", but the build->profile option was disabled. I assume that this is because it is a dll file. Is there any way to profile a plugin dll?

    I don't believe I've never heard of profiling before...



    • Advertising

      advertising
      EmuTalk.net
      has no influence
      on the ads that
      are displayed
        
       

  2. #2
    Moderator Hacktarux's Avatar
    Join Date
    Nov 2001
    Location
    France
    Posts
    1,174
    It's definitely something that i wanted to make when i have tried to improve the speed of the tr64 plugin. But i have never understand how it works with vc++.

    And i remember that i have found something on the microsoft site that says it's a bug of vc++: on some system the profile option is disabled and they gave a .reg file to solve this problem but it didn't enable the option....

  3. #3
    Moderator Dave2001's Avatar
    Join Date
    Dec 2001
    Location
    USA
    Posts
    310
    Hmm... I created a test exe & profiling seems to work just fine there. I created a test dll & the option was disabled again...

    Maybe if I start the profiling from the pj64 source?
    Last edited by Dave2001; July 5th, 2002 at 16:11.

  4. #4
    Moderator Dave2001's Avatar
    Join Date
    Dec 2001
    Location
    USA
    Posts
    310
    There seems to be ways to do it with dlls and such from command prompt, but the problem is that they don't create a .pbo file like they are supposed to...

  5. #5
    Moderator Dave2001's Avatar
    Join Date
    Dec 2001
    Location
    USA
    Posts
    310
    Whoa!!! I somehow did it, but I'm not sure quite how yet... Here's some of the output (i didn't run anything when i used pj64)

    I'll try to figure out what I did & post it here.

    Func Func+Child Hit
    Time % Time % Count Function
    ---------------------------------------------------------
    0.000 0.0 0.000 0.0 1 CountCombine(void) (combine.obj)
    0.000 0.0 0.000 0.0 1 INI_Close(void) (ini.obj)
    0.000 0.0 0.000 0.0 1 INI_FindSection(char *) (ini.obj)
    0.000 0.0 0.000 0.0 17 INI_GetInt(char *,int,int) (ini.obj)
    0.000 0.0 0.000 0.0 1 INI_Open(void) (ini.obj)
    0.000 0.0 0.000 0.0 1 _$E17 (main.obj)
    0.000 0.0 0.000 0.0 1 _$E19 (main.obj)
    0.000 0.0 0.000 0.0 1 _$E20 (main.obj)
    0.000 0.0 0.000 0.0 2 _DllMain@12 (main.obj)
    0.000 0.0 0.000 0.0 1 _GetDllInfo (main.obj)
    0.000 0.0 0.000 0.0 1 _InitiateGFX (main.obj)
    0.000 0.0 0.000 0.0 1 _ReadSettings (main.obj)
    0.000 0.0 0.000 0.0 3 __mtlockinit (mtlock.obj)
    ...

  6. #6
    ????????????????????????? Doomulation's Avatar
    Join Date
    Nov 2001
    Location
    ????????????????
    Posts
    8,780
    Originally posted by Dave2001
    Whoa!!! I somehow did it, but I'm not sure quite how yet... Here's some of the output (i didn't run anything when i used pj64)

    I'll try to figure out what I did & post it here.

    Func Func+Child Hit
    Time % Time % Count Function
    ---------------------------------------------------------
    0.000 0.0 0.000 0.0 1 CountCombine(void) (combine.obj)
    0.000 0.0 0.000 0.0 1 INI_Close(void) (ini.obj)
    0.000 0.0 0.000 0.0 1 INI_FindSection(char *) (ini.obj)
    0.000 0.0 0.000 0.0 17 INI_GetInt(char *,int,int) (ini.obj)
    0.000 0.0 0.000 0.0 1 INI_Open(void) (ini.obj)
    0.000 0.0 0.000 0.0 1 _$E17 (main.obj)
    0.000 0.0 0.000 0.0 1 _$E19 (main.obj)
    0.000 0.0 0.000 0.0 1 _$E20 (main.obj)
    0.000 0.0 0.000 0.0 2 _DllMain@12 (main.obj)
    0.000 0.0 0.000 0.0 1 _GetDllInfo (main.obj)
    0.000 0.0 0.000 0.0 1 _InitiateGFX (main.obj)
    0.000 0.0 0.000 0.0 1 _ReadSettings (main.obj)
    0.000 0.0 0.000 0.0 3 __mtlockinit (mtlock.obj)
    ...
    That's function profiling.
    It lists how many times your functions get called. It's useful to see if a function gets called lots, then you should try to optimize that function, and then you can see which functions that are NOT called. Those should be removed, saves you size

    There's other profiling options as well, Dave. Try them, too.

    Hacktarux: Profiling isn't hard at all to use. You just need to have an EXE to do it the easy way.

    You simply goto options and select "enable profiling" in debug. Then goto build-->profile and you can select a method of profiling. When selected, click OK and the app will automaticlly compile and run. After it's done, you'll see the results of the profiling.
    Atashi wa juu-yon-sai no onna no ko! Atashi no namae wa Miizuki. Yurushiku ne!
    Nani? Atashi o shinjirimasen desu ka? Baka!
    "You're all doomed! Doomed, I say! Hehe... are we approaching the end of the world?"

    shikata ga kaite aru - "the instructions are written above"
    Need to download GoodN64 or instructions to use it? Need to check if it's a good or bad rom?
    Download: Glide64 | Hacktarux's wrapper

  7. #7
    Moderator Dave2001's Avatar
    Join Date
    Dec 2001
    Location
    USA
    Posts
    310
    i can't get it to happen again

    jeez... i wrote a simple hello world application & it still does not profile like they say it should...

    PREP : fatal error PRF1011: cannot open file c:\programming\proftest\release\proftest .pbo

  8. #8
    Moderator Rice's Avatar
    Join Date
    Nov 2001
    Location
    U.S.
    Posts
    1,578
    Dave, you can try Intel's Vtune 5.0 or 6.0, or if you can find, try TrueTime, they are professional profiler.

    I don't think you can do multi-thread profiling in VC. I tried it before, it did not work, and I remember MS said VC only support single-thread profiling.
    - Rice
    http://1964emu.emulation64.com

  9. #9
    Moderator Dave2001's Avatar
    Join Date
    Dec 2001
    Location
    USA
    Posts
    310
    Thanks Rice, vtune works great.

    25% of the time in Glide64.dll is spent calculating vertices (transformation, lighting), which is understandable

    10% is in my CopyBlock function, which can be optimized lots

  10. #10
    ????????????????????????? Doomulation's Avatar
    Join Date
    Nov 2001
    Location
    ????????????????
    Posts
    8,780
    Originally posted by Dave2001
    Thanks Rice, vtune works great.

    25% of the time in Glide64.dll is spent calculating vertices (transformation, lighting), which is understandable

    10% is in my CopyBlock function, which can be optimized lots
    Yet, more speed increase!
    Atashi wa juu-yon-sai no onna no ko! Atashi no namae wa Miizuki. Yurushiku ne!
    Nani? Atashi o shinjirimasen desu ka? Baka!
    "You're all doomed! Doomed, I say! Hehe... are we approaching the end of the world?"

    shikata ga kaite aru - "the instructions are written above"
    Need to download GoodN64 or instructions to use it? Need to check if it's a good or bad rom?
    Download: Glide64 | Hacktarux's wrapper

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •