Click here to Skip to main content
15,882,598 members
Home / Discussions / C#
   

C#

 
GeneralRe: reading magnetic card stripe Pin
Pete O'Hanlon15-Jul-14 1:49
mvePete O'Hanlon15-Jul-14 1:49 
AnswerRe: reading magnetic card stripe Pin
Gerry Schmitz15-Jul-14 9:18
mveGerry Schmitz15-Jul-14 9:18 
QuestionC# , Websocket -HTTPS Pin
sgeorge10615-Jul-14 0:49
sgeorge10615-Jul-14 0:49 
AnswerRe: C# , Websocket -HTTPS Pin
Pete O'Hanlon15-Jul-14 1:45
mvePete O'Hanlon15-Jul-14 1:45 
GeneralRe: C# , Websocket -HTTPS Pin
sgeorge10615-Jul-14 8:27
sgeorge10615-Jul-14 8:27 
QuestionIntegrating with Intelligent Networks Using MML in C# Pin
tnashc14-Jul-14 23:00
tnashc14-Jul-14 23:00 
SuggestionRe: Integrating with Intelligent Networks Using MML in C# Pin
Richard MacCutchan14-Jul-14 23:41
mveRichard MacCutchan14-Jul-14 23:41 
QuestionRefactoring versus Performance Pin
Agent__00714-Jul-14 19:42
professionalAgent__00714-Jul-14 19:42 
I have been asked to refactor a couple of modules which are extremely critical with respect to the performance and are already taking a few seconds more than the desired time. So, they later will be worked on performance optimizations as well.

I have come across following block of code:
// some method declarations and statements here 

foreach // <-- iterating about 30 times
  // some loop declarations
  foreach // <-- iterating about 150 times
     // some loop declarations
     foreach // <-- iterating about 500 times
         // some loop declarations
         // some statements -> good candidates for 
         //             refactoring as method-calls within current DLL as well as external one   (##)
     end
   end
end         

// some method-statements here


I was thinking to refactor the statements ((##) above). But as per my knowledge, method calls do take finite amount of execution time for push/pop onto/from the stack. Considering these modules are really critical w.r.t. the performance (as in any other relevant scenario):

0. Should I really be considering function-call times while dealing with performance?
1. Should I really go ahead with refactoring the above statements (especially for those which involve significant number of push/pop operations)?
1.1. If yes, should I refactor those statements to methods only in current DLL or the external one is also feasible?

Any pointers will be appreciated. Thanks!
Whether I think I can, or think I can't, I am always bloody right!

AnswerRe: Refactoring versus Performance Pin
Bernhard Hiller14-Jul-14 20:36
Bernhard Hiller14-Jul-14 20:36 
GeneralRe: Refactoring versus Performance Pin
Agent__00714-Jul-14 20:55
professionalAgent__00714-Jul-14 20:55 
AnswerRe: Refactoring versus Performance Pin
Kornfeld Eliyahu Peter14-Jul-14 21:35
professionalKornfeld Eliyahu Peter14-Jul-14 21:35 
GeneralRe: Refactoring versus Performance Pin
Agent__00714-Jul-14 21:49
professionalAgent__00714-Jul-14 21:49 
GeneralRe: Refactoring versus Performance Pin
OriginalGriff14-Jul-14 21:49
mveOriginalGriff14-Jul-14 21:49 
AnswerRe: Refactoring versus Performance Pin
OriginalGriff14-Jul-14 21:03
mveOriginalGriff14-Jul-14 21:03 
GeneralRe: Refactoring versus Performance Pin
Agent__00714-Jul-14 21:45
professionalAgent__00714-Jul-14 21:45 
GeneralRe: Refactoring versus Performance Pin
Rob Philpott14-Jul-14 21:48
Rob Philpott14-Jul-14 21:48 
GeneralRe: Refactoring versus Performance Pin
OriginalGriff14-Jul-14 21:53
mveOriginalGriff14-Jul-14 21:53 
GeneralRe: Refactoring versus Performance Pin
Rob Philpott14-Jul-14 22:12
Rob Philpott14-Jul-14 22:12 
GeneralRe: Refactoring versus Performance Pin
OriginalGriff14-Jul-14 22:45
mveOriginalGriff14-Jul-14 22:45 
GeneralRe: Refactoring versus Performance Pin
Rob Philpott14-Jul-14 22:54
Rob Philpott14-Jul-14 22:54 
GeneralRe: Refactoring versus Performance Pin
Rob Philpott14-Jul-14 22:28
Rob Philpott14-Jul-14 22:28 
GeneralRe: Refactoring versus Performance Pin
OriginalGriff14-Jul-14 22:38
mveOriginalGriff14-Jul-14 22:38 
GeneralRe: Refactoring versus Performance Pin
Agent__00714-Jul-14 22:14
professionalAgent__00714-Jul-14 22:14 
GeneralRe: Refactoring versus Performance Pin
Rob Philpott14-Jul-14 22:18
Rob Philpott14-Jul-14 22:18 
GeneralRe: Refactoring versus Performance Pin
Agent__00714-Jul-14 22:24
professionalAgent__00714-Jul-14 22:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.