Harbour 3.2 con Profiler para Borland 32 bits

Post Reply
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Harbour 3.2 con Profiler para Borland 32 bits

Post by Antonio Linares »

1. We download the Harbour source code:

git.exe clone --progress -v "https://github.com/harbour/core.git" "C:\harbour"

2. We build it this way:

go.bat

Code: Select all

set path=c:\bcc7\bin
set HB_WITH_OPENSSL=c:\OpenSSL-Win32\include
set HB_WITH_CURL=c:\curl\include
set HB_USER_CFLAGS=-DHB_USE_PROFILER
win-make.exe
3. Download it from here already built:
https://bitbucket.org/fivetech/harbour- ... ofiler.zip
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Harbour 3.2 con Profiler para Borland 32 bits

Post by Antonio Linares »

How to use the Harbour Profiler:

1. Install the provided Harbour with profiler

2. At the beginning of your app call this:

__SetProfiler( .T. )

3. Before exiting your app call this:

ShowProfiler()

4. Add this code to your main PRG:

Code: Select all

#include "xbrowse.ch"

Code: Select all

function ShowProfiler()

   local aValues := {}, n

   for n := 1 TO __dynsCount()
      if __dynsIsFun( n )
         AAdd( aValues, { __dynsGetName( n ), __dynsGetPrf( n )[ 1 ], __dynsGetPrf( n )[ 2 ] } )
      endif
   next

   XBROWSER ASort( aValues,,, { | x, y | x[ 1 ] < y[ 1 ] } ) ;
      TITLE "Profiler results" ;
      SETUP BrwSetup( oBrw, "Name" ) AUTOSORT

   aValues = {}

   for n = 0 to __opCount() - 1
      AAdd( avalues, { n, __opGetPrf( n )[ 1 ], __opGetPrf( n )[ 1 ] } )
   next      

   XBROWSER ASort( aValues,,, { | x, y | x[ 1 ] < y[ 1 ] } ) ;
      TITLE "Profiler opcodes results" ;
      SETUP BrwSetup( oBrw, "opcode" ) AUTOSORT

return nil 

function BrwSetup( oBrw, cType )

   oBrw:aCols[ 1 ]:cHeader = cType
   oBrw:aCols[ 2 ]:cHeader = "Times"
   oBrw:aCols[ 3 ]:cHeader = "Time"
   
return nil  
regards, saludos

Antonio Linares
www.fivetechsoft.com
Horizon
Posts: 997
Joined: Fri May 23, 2008 1:33 pm

Re: Harbour 3.2 con Profiler para Borland 32 bits

Post by Horizon »

Hi Antonio,

What is harbour profiler? :oops:
Regards,

Hakan ONEMLI

Harbour & VS 2019 & FWH 20.12
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Harbour 3.2 con Profiler para Borland 32 bits

Post by Antonio Linares »

Hakan,

https://en.wikipedia.org/wiki/Profiling ... ogramming)
Provides measurements of application performance. The better ones isolate methods that:

1. Consume the most amount of time
2. Have the most amount of calls
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Harbour 3.2 con Profiler para Borland 32 bits

Post by Antonio Linares »

Image

Image

Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Lailton
Posts: 99
Joined: Fri Jul 20, 2012 1:49 am
Location: Brazil
Contact:

Re: Harbour 3.2 con Profiler para Borland 32 bits

Post by Lailton »

Hi Antonio,

Very interesting.

One question, the "__SetProfiler( .t. )" is one procedure of FiveWin or Harbour?

Thanks for share!
Regards,
Lailton Fernando Mariano
https://www.harbour.ninja
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Harbour 3.2 con Profiler para Borland 32 bits

Post by Antonio Linares »

Lailton,

It belongs to Harbour
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Lailton
Posts: 99
Joined: Fri Jul 20, 2012 1:49 am
Location: Brazil
Contact:

Re: Harbour 3.2 con Profiler para Borland 32 bits

Post by Lailton »

Thank you :)
Regards,
Lailton Fernando Mariano
https://www.harbour.ninja
marzio
Posts: 129
Joined: Wed Apr 04, 2007 6:54 am

Re: Harbour 3.2 con Profiler para Borland 32 bits

Post by marzio »

i have added IF aScan( aValues, { | x | x[ 2 ] > 0 } ) > 0 to avoid opening of the 2 empty tables if the code is compiled without profiler or __SetProfiler( .f. )

Code: Select all

function ShowProfiler()

   local aValues := {}, n

   for n := 1 TO __dynsCount()
      if __dynsIsFun( n )
         AAdd( aValues, { __dynsGetName( n ), __dynsGetPrf( n )[ 1 ], __dynsGetPrf( n )[ 2 ] } )
      endif
   next

   IF aScan( aValues, { | x | x[ 2 ] > 0 } ) > 0
      XBROWSER ASort( aValues,,, { | x, y | x[ 1 ] < y[ 1 ] } ) ;
         TITLE "Profiler results" ;
         SETUP BrwSetup( oBrw, "Name" ) AUTOSORT

      aValues = {}

      for n = 0 to __opCount() - 1
         AAdd( avalues, { n, __opGetPrf( n )[ 1 ], __opGetPrf( n )[ 1 ] } )
      next      

      XBROWSER ASort( aValues,,, { | x, y | x[ 1 ] < y[ 1 ] } ) ;
         TITLE "Profiler opcodes results" ;
         SETUP BrwSetup( oBrw, "opcode" ) AUTOSORT
   ENDIF

return nil

function BrwSetup( oBrw, cType )

   oBrw:aCols[ 1 ]:cHeader = cType
   oBrw:aCols[ 2 ]:cHeader = "Times"
   oBrw:aCols[ 3 ]:cHeader = "Time"
   
return nil  
 
Post Reply