Supporting The Revolution In Your World.
Sep 07, 2010
 
perl I have uploaded a new version of my SQR source code analyzer perl script [here]. This version adds support for the #IF statements (eg. #IF {TEST} = 'Y'). Also added is a new command line option (-sk) that allows you to specify procedure names NOT TO trace when doing the analysis of the source code (one SQR I analyzed called a procedure 24,599 times).
The program that I was having problems analyzing got me thinking about performance, and how I could improve it, so after adding the "skip" code to the program, I profiled this "nasty" SQR. In total, this SQR includes 67 include files and runs over 40,000 lines of code. I ran the Perl profiler on the script as it analyzies this SQR (perl -d:DProf sqr-analyzer.pl...) and the following is the output of the profiler information (dprofpp tmon.out):

    Total Elapsed Time = 9652.995 Seconds
    User+System Time = 1349.652 Seconds
    Exclusive Times
    %Time ExclSec CumulS #Calls sec/call Csec/c Name
    98.3 1326. 19012. 46976 0.0282 0.4047 main::process_function_call
    0.76 10.27 9.709 190126 0.0001 0.0001 main::print_function_tree_indent
    0.63 8.535 19028. 71575 0.0001 0.2659 main::process_function_call_line
    0.27 3.608 2.892 238931 0.0000 0.0000 main::clean_line
    0.26 3.451 4.265 62828 0.0001 0.0001 main::process_preproc_if
    0.16 2.114 1.900 71575 0.0000 0.0000 main::remove_from_call_tree
    0.10 1.332 1.117 71575 0.0000 0.0000 main::add_to_call_tree
    0.07 0.995 1.663 68 0.0146 0.0245 main::source_scan
    0.03 0.400 0.400 68 0.0059 0.0059 main::get_file_location
    0.01 0.170 0.170 1 0.1700 0.1700 main::print_function_list_by_sqc
    0.00 0.060 0.060 1 0.0600 0.0600 main::print_define_list_by_SQC
    0.00 0.050 0.050 670 0.0001 0.0001 main::process_procedure
    0.00 0.010 0.010 1 0.0100 0.0100 main::print_function_list_by_function
    0.00 0.010 0.008 670 0.0000 0.0000 main::add_to_function_list
    0.00 0.010 0.010 1 0.0100 0.0100 main::print_function_call_stats
The process using the most time is running at a little over .02 seconds per call, I am not sure I can improve this too much. This program that I profiled took the longest by far (2 hrs, 40 min on a P4 1.8GHz machine under Cygwin, 50 minutes on a Sun Ultra server with 12 CPU's).
Posted by Admin on Wednesday, February 18, 2004 (1846 Reads)
    Printer-friendly page
SQR Analyzer -- New Version | Log-in or register a new user account | 0 Comments
Comments are statements made by the person that posted them.
They do not necessarily represent the opinions of the site editor.

100% Canadian

Online

There are 1 unlogged user and 0 registered users online.

You can log-in or register for a user account here.

Languages

Preferred language:


 

Current Poll

Favourite Programming Language

  • BASIC
  • C
  • C++
  • Perl
  • SQR
  • PeopleCode
  • Assembler
  • COBOL
  • Java
  • .Net
  • PHP
  • Fortran

[ Results | Polls ]

Votes: 35
Comments: 23

Weather

Edmonton, Alberta

Click for Edmonton City Centre, Alberta Forecast

Login





 


 Log in Problems?
 New User? Sign Up!

Past Articles