Re: Why my application is so LAZY? Please help me out!!!!
Quote:
Originally Posted by shinde
:blush: :blush:
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 :blush: :blush: !!!
If possible forgive me.
Thanks to all......
With Regards........
Ha ha ha
It looks like ur code is not the only thing sleepin ;)
Happens to everyone sometimes
Hey one more thing...
Be careful when u do stuff like....
Quote:
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.
Searchin inside a string, putting it in a loop, and using CStrings will KILL ur application on performance. Eliminate the option of using CStrings completely on such occassions. Use char, wchar_t on such occassions.
Re: Why my application is so LAZY? Please help me out!!!!
Quote:
Originally Posted by shinde
Please Kindly read my previous replies.Thank you.
Yeah, you're right. I just replied to the first question. I didn't read all the way down. My mistake.
Quote:
Originally Posted by shinde
If no luck then I have to sit and debug...
That's really very scaring me......
I know you've solved your problem now, but let me be honest with you for a second. You need to learn to debug -- and to not be afraid of it. It's a part of any (successful) programmer's life! It's never fun to do under pressure, but that comes with the territory. Anyway, I strongly urge you to either buy a book about debugging and/or scour the web for such information. Also, look around for books/web content on defensive programming skills: static assertions (compile-time asserts), smart asserts, tracing, discussions about coupling, cohesion, and testability, etc.... Another book I'd recommend reading is "The Pragmatic Programmer" -- it talks about defensive programming, but not in the ways I mentioneed above -- it alone is not a complete guide to defensive programming. Definitely read the book, but do look for other defensive programming books too. These things will make you a much more valuable programmer to any buisness -- your own or to some company.
Quote:
Originally Posted by shinde
sleep() function is called in my application!!!
LOL! Things such as this happen.
Quote:
Originally Posted by shinde
If possible forgive me.
Thanks to all......
Don't worry about it. No problem! :)
Re: Why my application is so LAZY? Please help me out!!!!
Quote:
Originally Posted by Pink Panther
Searchin inside a string, putting it in a loop, and using CStrings will KILL ur application on performance. Eliminate the option of using CStrings completely on such occassions. Use char, wchar_t on such occassions.
I strongly disagree. Actually, due to CString's reference counting mechanism, I've seen code which was actually faster with CString as compared to the use of char arrays (where string memory was constantly reallocated and copied). Also, any string operation which needs to check the length of the string is faster with CString as when searching the NULL terminator in a char array.
Re: Why my application is so LAZY? Please help me out!!!!
Quote:
Originally Posted by gstercken
I strongly disagree. Actually, due to CString's reference counting mechanism, I've seen code which was actually faster with CString as compared to the use of char arrays (where string memory was constantly reallocated and copied). Also, any string operation which needs to check the length of the string is faster with CString as when searching the NULL terminator in a char array.
Yup. :thumb::thumb::thumb:
I have seen code that modifies strings byte by byte, and character by character.
Such code is difficult to understand, and tough to maintain.
The usage of String classes like CString, or std:string not only makes the code a lot shorter (and reduces time to delivery), but, also makes it easy to explain, understand and maintain functionality.
When used correctly, these classes are as fast, or faster.