Why my application is so LAZY? Please help me out!!!!
Hello everybody :wave: ,
my application is a dialog based.It takes a "Text file" as INPUT and after parsing the input file it gives a "Text file" as OUTPUT.
But to generate the "text file" (I mean the OUTPUT file) it taking around
3.30 hours!!! :eek:
I dont know why it is taking that much time. :ehh:
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.
Anybody come across with this type of problem?
Any clues?
Thanks.
Re: Why my application is so LAZY? Please help me out!!!!
Without seeing your code, we have no idea :D
Re: Why my application is so LAZY? Please help me out!!!!
Quote:
Orginally posted by szz_zoli
Without seeing your code, we have no idea :D
I'm sorry zoli, due to some reasons I cant share the code.
Any wild guesses?
Thanks....
Re: Why my application is so LAZY? Please help me out!!!!
Can you tell us, what is your program supposed to do?
How big is the input/output file?
What algorithm(s) were used?
Re: Why my application is so LAZY? Please help me out!!!!
How big is you input text file?
Re: Why my application is so LAZY? Please help me out!!!!
How BIIIIIIIIG is your input file?
Re: Why my application is so LAZY? Please help me out!!!!
Quote:
Orginally posted by szz_zoli
Can you tell us, what is your program supposed to do?
How big is the input/output file?
What algorithm(s) were used?
Input is of size around some 30 KB and output file will be around 4 MB .
No special algorithms were used.
Actually the input file contains 2 digits to 3 digits numbers, using these values my application performs some multiplications, substractions, divisions etc.
Nothing more than that.
I'm sure.
Thanks...
Re: Why my application is so LAZY? Please help me out!!!!
I think the operations take so long time. Maybe you have WHILE or FOR structures which takes a long time to be completed.
Can you write the steps of the operations? Whitout the code is hard to understand why. :ehh:
Re: Why my application is so LAZY? Please help me out!!!!
To read from a file and write into another file shouldn't take more than 5 seconds(depends of PC).
Re: Why my application is so LAZY? Please help me out!!!!
Quote:
Originally Posted by shinde
Input is of size around some 30 KB and output file will be around 4 MB .
No special algorithms were used.
Actually the input file contains 2 digits to 3 digits numbers, using these values my application performs some multiplications, substractions, divisions etc.
Nothing more than that.
I'm sure.
Thanks...
Hey...
Are u doing a lot of string manipulations??? i mean a lot????
using CString and assigining, appending, ect in a loop of some sort????
Re: Why my application is so LAZY? Please help me out!!!!
Quote:
Orginally posted by bujcat
Can you write the steps of the operations?
Ok bujcat, I will try my best. Please give me some time.
Thanks...
Re: Why my application is so LAZY? Please help me out!!!!
Since u are playing with numbers, check out with just one entry in input file and see the performance.
Re: Why my application is so LAZY? Please help me out!!!!
First suggestion: profile your code. See if there are any easy to identify bottlenecks
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.
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?
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.
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.
Re: Why my application is so LAZY? Please help me out!!!!
Quote:
Originally Posted by Pink Panther
Since u are playing with numbers, check out with just one entry in input file and see the performance.
Gooood Idea!
Ok, I will try now.
bujcat, dont mind, I'm delaying your request for some time.
I will try as Pink Panther mentioned.
Meanwhile please give your valuable suggestions...
Thanks.
Re: Why my application is so LAZY? Please help me out!!!!
Profiling will help.
Use Function Profiling to find:
- Number of times a Function is executed.
- Time spent in each Function.
This FAQ is relevant too.