|
-
May 5th, 2005, 06:30 AM
#16
Re: Why my application is so LAZY? Please help me out!!!!
Orginally posted by Kevin Hall
First suggestion: profile your code. See if there are any easy to identify bottlenecks
Ok.
Orginally posted by Kevin Hall
Second suggestion: Give us something to work with. If you can't share code, can you share the psuedo code? Flow chart? We can only guess what might be wrong if you can't share what's happening.
Hummmmm...
Orginally posted by Kevin Hall
Third suggestion: Tell us what your program does. What exactly are you trying to process? Where is the data coming from? Where are you writing the output to? How much data are you analyzing? What do you have to do to the text?
Please Kindly read my previous replies.Thank you.
Orginally posted by Kevin Hall
Fourth suggestion: Check for common string manipulation performance killers:
* unnecessary copying of string data. See if you can return references to strings instead
* inserting / removal of text in the midlle of a very large string. If this operation occurs often, it's usually quicker to read data as a vector of smaller strings -- for example a text file can often be read as a vector of text lines.
Yes, you are right, I will look at it.
Orginally posted by Kevin Hall
Fifth suggestion: Hire a contractor. If you don't want to debug it yourself, there are a lot of people out there willing to do it if they get paid.
Hahaha, hey friend, actually it is written by some other programmer, otherwise I would have tried to find the problem.
I can debug, I believe it takes long time.
for example, this application calls a funtions for checking spaces in the input file for more than 1 million (100000) times!!!
And lots of while and for loops are there.
Now I'm trying here for any luck (I mean any help from you gurus...)
If no luck then I have to sit and debug...
That's really very scaring me......
Thanks...
-
May 5th, 2005, 06:33 AM
#17
Re: Why my application is so LAZY? Please help me out!!!!
Hai Siddhartha,
Ok, I will do profiling and reply you soon....
Thank You.
-
May 5th, 2005, 06:35 AM
#18
Re: Why my application is so LAZY? Please help me out!!!!
Hi,
my suggestion is, try to implement logging for your application with time.
From that you can find out where it is taking long time.
Regards
MJValan
-
May 5th, 2005, 07:05 AM
#19
Re: Why my application is so LAZY? Please help me out!!!!
Orginally posted by mjvalan
my suggestion is, try to implement logging for your application with time.
From that you can find out where it is taking long time.
Hai mjvalan, logging for application with time? how to do that? please can you explain me? I'm little confused.
Thanks.
-
May 5th, 2005, 07:51 AM
#20
Re: Why my application is so LAZY? Please help me out!!!!
You may ve seen log files in your system, which has information about execution of some applications in your machine.
In your program write some extra lines to create a file and write some messages with the system time.
Ex
main()
{
CreateFile("c:\xyz.log",...);
GetsystemeTime() // I am not writing exact funtions.
writeFile(Time+" Entering into main");
....
....
....
GetsystemTime()
WriteFile(Time+"calling fun blabla");
blabla();
GetsystemTime()
WriteFile(Time+" fun blabla completed ");
....
...
GetsystemTime();
writeFile(Time+"Exiting function main");
}
==============================
Accroding to your requiremnet you can increase log statements in your program.
Now by veryfing the log file you can find out that, howmuch time function blabla has taken.
If you feel blabla is taking more time , then add some log statements in function blabla. So that you can find out the exact statement where it is taking more time.
(Most of the programs will take more time in for/ while loops)
-
May 5th, 2005, 08:18 AM
#21
Re: Why my application is so LAZY? Please help me out!!!!
Thanks a lot mjvalan for giving the hint.
I will also try this way.
Thanks to all.....
-
May 5th, 2005, 08:27 AM
#22
Re: Why my application is so LAZY? Please help me out!!!!
BTW, FYI, in the FAQ link mentioned before, Andreas has posted a Timer Class. You may use that too.
-
May 5th, 2005, 08:48 AM
#23
Re: Why my application is so LAZY? Please help me out!!!!
 Originally Posted by shinde
Ok.
I can debug, I believe it takes long time.
for example, this application calls a funtions for checking spaces in the input file for more than 1 million (100000) times!!!
And lots of while and for loops are there.
Now I'm trying here for any luck (I mean any help from you gurus...)
If no luck then I have to sit and debug...
That's really very scaring me......
Thanks...
Sounds like you have your answer.
-
May 5th, 2005, 09:03 AM
#24
Re: Why my application is so LAZY? Please help me out!!!!
Orginally Posted by Siddhartha
BTW, FYI, in the FAQ link mentioned before, Andreas has posted a Timer Class. You may use that too.
Ok, sure, thank you Siddhartha.
Orginally Posted by GCDEF
Sounds like you have your answer.
Hai GCDEF, sorry, I did not get you!!!
What do you mean? please explain....
I'm leaving for today. Tommarrow I hope, after following all your suggestions, I may(will) come up with the good result, and reply you all about the status.
But GCDEF, please reply me.Thanks.
Thanks to all.
-
May 5th, 2005, 09:13 AM
#25
Re: Why my application is so LAZY? Please help me out!!!!
 Originally Posted by shinde
Ok, sure, thank you Siddhartha.
Hai GCDEF, sorry, I did not get you!!!
What do you mean? please explain....
I'm leaving for today. Tommarrow I hope, after following all your suggestions, I may(will) come up with the good result, and reply you all about the status.
But GCDEF, please reply me.Thanks.
Thanks to all.
Look at what I quoted. You said it's calling the same function to check for spaces over a million times. Why?
-
May 5th, 2005, 09:57 AM
#26
Re: Why my application is so LAZY? Please help me out!!!!
I have to respond, please take this kindly:
 Originally Posted by shinde
I'm sorry zoli, due to some reasons I cant share the code.
Any wild guesses?
Thanks....
We are not fortune tellers or psychic. No one can determine what makes your program slow without seeing what you're doing.
And moreover this application is written by some other programmer, so now I'm scaring to debug the application for finding the reason for the delay in generating the output file
But isn't that what programmers are supposed to do at some point in their programming lives, and that is to debug other people's code? If you're scared to debug it, how in the world are you going to fix it?
Regards,
Paul McKenzie
Last edited by Paul McKenzie; May 5th, 2005 at 10:03 AM.
-
May 5th, 2005, 02:15 PM
#27
Re: Why my application is so LAZY? Please help me out!!!!
I think you maybe using MFC's CArray class with structures having static members? This can dramatically slow down your application. This because CArray is have this problem. If you are using this class, I strongly recommend eleminating this using other options.
-
May 5th, 2005, 03:14 PM
#28
Re: Why my application is so LAZY? Please help me out!!!!
He also may be calling malloc() and free() a million times.
The problem is that the poster has yet to reveal *any* code to us, so guessing what is wrong won't be productive.
Regards,
Paul McKenzie
-
May 6th, 2005, 08:10 AM
#29
Re: Why my application is so LAZY? Please help me out!!!!
I have parsed a text file of about 25 mb and stored the data into database table.
Its taking just 37 minutes to do that on a PIV,256 MB Machine.
VC++ is really too fast in parsing files ur extraction and calculation routine has got the problem.
I am sure, try using interger datatypes in places of floats where not required.
Regards
PS
-
May 7th, 2005, 12:06 AM
#30
Re: Why my application is so LAZY? Please help me out!!!!
I'm extreamly sorry for giving you trouble. It's my mistake, I did not checked the code properly.
I found the problem.
sleep() function is called in my application !!!
If possible forgive me.
Thanks to all......
With Regards........
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|