Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8419515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:38:08+00:00 2026-06-10T02:38:08+00:00

I have a helper method that takes a begin date and an end date

  • 0

I have a helper method that takes a begin date and an end date and through certain business logic yields an integer result. This helper method is sometimes called in excess of 10,000 times for a given set of data (though this doesn’t occur often).

Question:
Considering performance only, is it more efficient to make this helper method as a static method to some helper class, or would it be more gainful to have the helper method as a public method to a class?

Static method example:

// an iterative loop
foreach (var result in results) {
    int daysInQueue = HelperClass.CalcDaysInQueue(dtBegin, dtEnd);
}

Public member method example:

// an iterative loop
HelperClass hc = new HelperClass();
foreach (var result in results) {
    int daysInQueue = hc.CalcDaysInQueue(dtBegin, dtEnd);
}

Thanks in advance for the help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T02:38:09+00:00Added an answer on June 10, 2026 at 2:38 am

    When you call an instance method the compiler always invisibly passes one extra parameter, available inside that method under this name. static methods are not called on behalf of any object, thus they don’t have this reference.

    I see few benefits of marking utility methods as static:

    • small performance improvement, you don’t pay for a reference to this which you don’t really use. However I doubt you will ever see the difference.

    • convenience – you can call static method wherever and whenever you want, the compiler is not forcing you to provide an instance of an object, which is not really needed for that method

    • readability: instance method should operate on instance’s state, not merely on parameters. If it’s an instance method not needing an instance to work, it’s confusing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a helper method drawRect(p1, p2) that draws a rectangle (in orthographic projection).
I have an object obj that is passed into a helper method. public static
In my rails project I have a presenter method that has a helper view
I have a method that takes an array of strings and joins them so
Hi I have a helper method, which returns a string, where i need to
I have a helper class that I want to display a UIAlertView then will
I have a helper class that should only ever run in a background thread.
I have a helper class that is passed an array of values that is
I want to create a helper method that can take in ANY type of
I have a function that takes a string object name and I need the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.