Harbour 3.2 con Profiler para Borland 32 bits

Harbour 3.2 con Profiler para Borland 32 bits

Postby Antonio Linares » Tue Mar 13, 2018 8:33 am

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  Expand view  RUN
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-xharbour-builds/downloads/harbour_bcc7_32bits_profiler.zip
regards, saludos

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

Re: Harbour 3.2 con Profiler para Borland 32 bits

Postby Antonio Linares » Tue Mar 13, 2018 9:09 am

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  Expand view  RUN
#include "xbrowse.ch"


Code: Select all  Expand view  RUN
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
User avatar
Antonio Linares
Site Admin
 
Posts: 42100
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Harbour 3.2 con Profiler para Borland 32 bits

Postby Horizon » Tue Mar 13, 2018 2:07 pm

Hi Antonio,

What is harbour profiler? :oops:
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: Harbour 3.2 con Profiler para Borland 32 bits

Postby Antonio Linares » Tue Mar 13, 2018 4:24 pm

Hakan,

https://en.wikipedia.org/wiki/Profiling_(computer_programming)

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: 42100
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Harbour 3.2 con Profiler para Borland 32 bits

Postby Antonio Linares » Tue Mar 13, 2018 4:33 pm

Image

Image

Image
regards, saludos

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

Re: Harbour 3.2 con Profiler para Borland 32 bits

Postby Lailton » Thu Mar 15, 2018 8:38 pm

Hi Antonio,

Very interesting.

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

Thanks for share!
Regards,
Lailton Fernando Mariano
User avatar
Lailton
 
Posts: 153
Joined: Fri Jul 20, 2012 1:49 am
Location: Brazil

Re: Harbour 3.2 con Profiler para Borland 32 bits

Postby Antonio Linares » Fri Mar 16, 2018 7:26 am

Lailton,

It belongs to Harbour
regards, saludos

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

Re: Harbour 3.2 con Profiler para Borland 32 bits

Postby Lailton » Fri Mar 16, 2018 8:52 pm

Thank you :)
Regards,
Lailton Fernando Mariano
User avatar
Lailton
 
Posts: 153
Joined: Fri Jul 20, 2012 1:49 am
Location: Brazil

Re: Harbour 3.2 con Profiler para Borland 32 bits

Postby marzio » Thu Mar 29, 2018 8:15 am

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  Expand view  RUN
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  
 
marzio
 
Posts: 129
Joined: Wed Apr 04, 2007 6:54 am


Return to WhatsNew / Novedades

Who is online

Users browsing this forum: No registered users and 23 guests