Click here to Skip to main content
15,885,546 members
Home / Discussions / C#
   

C#

 
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 
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 
If you are seriously considering performance, and have issues already then refactoring inline code to methods will make the problem worse, not better: there is a small overhead in each method call that is not present in the inline version. Depending on parameter usage, it can become less than trivial, particularly when executed in nested loops. And you are executing that code 2,250,000 times, so any small increase in execution time can become significant when considered against the loop as a whole.

I'd start with looking at the code and the loops and seeing exactly what they all do, and if it's necessary before refactoring the code: at the moment it's fairly obvious how it's all interrelated and is anything can be moved out of the loop. Refactoring that into multiple DLLs would make that process a lot, lot harder.

But before you do anything add some timing code to monitor what is actually happening, so you can tell exactly if what you did improved or worsened the situation - and remember that the Release version will have different timings to teh Debug as it includes a lot more optimisations!
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)

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 
GeneralRe: Refactoring versus Performance Pin
Rob Philpott14-Jul-14 22:31
Rob Philpott14-Jul-14 22:31 
GeneralRe: Refactoring versus Performance Pin
Agent__00714-Jul-14 22:33
professionalAgent__00714-Jul-14 22:33 
AnswerRe: Refactoring versus Performance Pin
Pete O'Hanlon15-Jul-14 3:45
mvePete O'Hanlon15-Jul-14 3:45 
GeneralRe: Refactoring versus Performance Pin
Agent__00715-Jul-14 4:29
professionalAgent__00715-Jul-14 4:29 
GeneralRe: Refactoring versus Performance Pin
Pete O'Hanlon15-Jul-14 4:32
mvePete O'Hanlon15-Jul-14 4:32 
GeneralRe: Refactoring versus Performance Pin
Agent__00715-Jul-14 4:35
professionalAgent__00715-Jul-14 4:35 

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.