Solved

profiling a C++ CGI scipt

Posted on 1997-07-09
4
152 Views
Last Modified: 2013-12-25
Hi,

I need help in profiling a C++ CGI script using MS Visual C++ or any other tools. I need to know about the function coverage and function timings.
The normal procedure for profiling exe doesn't seem to work as it is a CGI script expecting a HTTP request.

Thanks

shantanu
0
Comment
Question by:shantanu070997
  • 2
  • 2
4 Comments
 
LVL 7

Accepted Solution

by:
faster earned 80 total points
ID: 1829004
It can just be a normal windows console program, just read from stdin/environment and write to the stdout, nothing much.
0
 

Author Comment

by:shantanu070997
ID: 1829005
Hi,

Thanks for your response.

I need some more clarifications.

The problem is that I need to set up the environment/stdin from where the cgi can read from it. I do not know how to do that.
As I understand this is set up by the web server when it receives an HTTP request.

Just running the exe is of no help, my problem is to invoke the
profiler when the cgi exe is invoked by the webserver.

shantanu
0
 
LVL 7

Expert Comment

by:faster
ID: 1829006
I don't quite understand what do you mean by "profiling a C++ CGI scipt".  Of course you will need a web server for testing, and I think microsoft personal web server is a good tool for that.  After you properly setup the server, everything else will just be normal C++ coding.  Maybe you could further clarify your needs.
0
 

Author Comment

by:shantanu070997
ID: 1829007
Hi,

I am sorry that I was not very clear about the question.
Well there is no problem with my CGI script or in running it.
It has been developed by a number of people and there is huge amount of redundant code in it. Now I want to find out how efficient the code is, i.e. things like how many times a function/method in the script is being called, how much of CPU time & other resources a particular function is consuming, etc. so that I can improve it's performance.

Microsoft Visual C++ has a tool called profiler which can be used for getting such statistics for all kind of projects. But I am unable to use that for a CGI-Script as the exe file expects that certain CGI environment variables are set, some input in stdin, etc. as usual.

Like the way i attach the VC++ debugger to the script, I want to know how i can do the same for the "profiler" in VC++.
OR
is there any other tools using which i can use to evaluate the performance of a C++ CGI script.

Sorry for the trouble
Thanx
shantanu
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now