Why is my code so slow??
-
Strange behavior in my code, every operation it had to do took 5 seconds.. At the end I found it:
System.Threading.Thread.Sleep(5000);
It was sitting there since the beggining of the project. Commented it, testing, and it worked normally. Can't remember why I made the system sleep 5 secs, on 10 operations it's ok, but on production we got 2'500 operations, took forever.. :zzz:
The signature is in building process.. Please wait...
Don't you just love comments.
Be excellent to each other. And... PARTY ON, DUDES! Abraham Lincoln
-
Don't you just love comments.
Be excellent to each other. And... PARTY ON, DUDES! Abraham Lincoln
-
Strange behavior in my code, every operation it had to do took 5 seconds.. At the end I found it:
System.Threading.Thread.Sleep(5000);
It was sitting there since the beggining of the project. Commented it, testing, and it worked normally. Can't remember why I made the system sleep 5 secs, on 10 operations it's ok, but on production we got 2'500 operations, took forever.. :zzz:
The signature is in building process.. Please wait...
Yeah, that would slow things down. Using a to do list would help to remember to clean up such things. It is like a comment, but looks like //TODO: Remove this after testing. Then you can see the to so list in Visual Studio :)
Just because the code works, it doesn't mean that it is good code.
-
Don't you just love comments.
Be excellent to each other. And... PARTY ON, DUDES! Abraham Lincoln
-
I actually hate them.. But they are usefull, I agree..
The signature is in building process.. Please wait...
I love them when other do them.
Be excellent to each other. And... PARTY ON, DUDES! Abraham Lincoln
-
Those that explain the bad code, or those to comment out the bad code ?
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus Do not feed the troll ! - Common proverb
Well, both are better then not. :doh:
Be excellent to each other. And... PARTY ON, DUDES! Abraham Lincoln
-
Those that explain the bad code, or those to comment out the bad code ?
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus Do not feed the troll ! - Common proverb
-
Yeah, that would slow things down. Using a to do list would help to remember to clean up such things. It is like a comment, but looks like //TODO: Remove this after testing. Then you can see the to so list in Visual Studio :)
Just because the code works, it doesn't mean that it is good code.
Yep - I do it all the time - so they show up in the VS "Task List". :thumbsup:
The only instant messaging I do involves my middle finger.
-
Strange behavior in my code, every operation it had to do took 5 seconds.. At the end I found it:
System.Threading.Thread.Sleep(5000);
It was sitting there since the beggining of the project. Commented it, testing, and it worked normally. Can't remember why I made the system sleep 5 secs, on 10 operations it's ok, but on production we got 2'500 operations, took forever.. :zzz:
The signature is in building process.. Please wait...
You should have decreased the value.
-
You should have decreased the value.
-
Maybe by twenty-five to fifty percent; you need to leave some.
-
Maybe by twenty-five to fifty percent; you need to leave some.
-
In this case I don't need it at all.. It was there for debugging, because without the sleep, debugging just went too fast.
The signature is in building process.. Please wait...
No you need to leave some delay in for a development holiday. When Boss Man says the app is too slow, tell him you'll have a look, spend two days faffing, reduce the wait by 20% and tell him you've optimised the code. Simples.
speramus in juniperus
-
Yeah, that would slow things down. Using a to do list would help to remember to clean up such things. It is like a comment, but looks like //TODO: Remove this after testing. Then you can see the to so list in Visual Studio :)
Just because the code works, it doesn't mean that it is good code.
:thumbsup:
Thanks -Amit Gajjar
-
No you need to leave some delay in for a development holiday. When Boss Man says the app is too slow, tell him you'll have a look, spend two days faffing, reduce the wait by 20% and tell him you've optimised the code. Simples.
speramus in juniperus
I guess you are doing the same :laugh:
Thanks -Amit Gajjar
-
You should have decreased the value.
Exactly. You understand the meaning of this valuable coding practise described in
"Real World Software Development - Volume I: Coding Patterns" by W., T., and F.