Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 1
    How did you determine you were having memory issues due to parameter passing? Have you done a performance/memory analysis of your app?
    – AlG
    Commented Jan 21, 2016 at 19:04
  • Yes, I was using a StopWatch instance to count the running time, and was bigger...
    – Clock
    Commented Jan 21, 2016 at 19:08
  • 2
    time is money, not memory.
    – jgauffin
    Commented Jan 21, 2016 at 19:37
  • 2
    Timing your app using StopWatch is not an effective way to find performance issues. It can be a decent way to compare algorithms but it requires MANY iterations to give menaingful results. Cosider looking at commercial profilers like Ants or dotTrace to get a more accurate understanding of possible performance issues. Passing parameters is very likely not one of your problems.
    – D Stanley
    Commented Jan 21, 2016 at 19:40
  • passing individual properties is going to be even worse if you think it's bad now. When you pass the object as a whole, you are sending a reference to it (basically c#'s version of a pointer) so one reference. If you send multiple properties instead, you're sending several references + some value copies (DateTime, bool). Any performance bottleneck you are experiencing must be coming from something else. Commented Jan 24, 2016 at 0:15