[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: Should PRIVATE STATIC be preferred over PRIVATE when...

  • Thread starter Thread starter frank.meulblok
  • Start date Start date
Status
Not open for further replies.
F

frank.meulblok

Guest
Note that the linked page and related ones claim a comparatively big performance gain when comparing a invoking a static method with "instantiating -> invoking in instance method -> eventual garbage collecting" for a single method call. So you're comparing "relying on the language and runtime to ensure the code only gets loaded once" with "coding to (potentially) flood the runtime with garbage". The performance difference won't be in invoking the method itself, it will be in the overhead surrounding the invocation. Instantiating the class once and keeping a reference around would get you a similar (theoretical) performance gain. That'd be the "explicitly code to ensure the code only gets loaded once".

Continue reading...
 
Status
Not open for further replies.
Back
Top