static or instance methods (performance)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

HI,

static class methods are shared, but even though i dont use them, they will
still occupy memory ? how much memory?

is static methods better than instance methods?

thanks,
 
By asking the question, you're admitting you've not yet run your application
through a profiler.

.... if you're not running your application through a performance profiler,
it means that the performance difference between a static & instance method
doesn't matter. The odds are 99%+ that your performance problems lay
elsewhere.

In short, go use a profiler and profile your app.

Some good profilers are:
Ants from Redgate .
dotTrace from JetBrains

both have free trials you can use to get started with.

As for the memory implications, I've yet to see a .Net application where
static versus instance would make a "real" difference. Instance methods are
going to take a bit more memory though, especially if they're virtual. I
can't think of a case where this would matter...
 
Back
Top