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 3804640
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:33:02+00:00 2026-05-19T14:33:02+00:00

I am wondering if using the accessor methods of a class within the class

  • 0

I am wondering if using the accessor methods of a class within the class itself will cause any performance problems. I am wondering about Java compilers specifically, but I suppose this is somewhat language agnostic.

  • 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-05-19T14:33:03+00:00Added an answer on May 19, 2026 at 2:33 pm

    AFAIK, newer JVM’s are very good at optimizing the bytecode on start up and in-the-fly.

    Documentation from J2SE SDK v 1.4.2 (which is already very old, like close to a decade) already mentions that the JVM will inline accessor-calls within a class:

    “The Java 2 release of the Java VM automatically inlines simple methods at runtime. In an un-optimized Java VM, every time a new method is called, a new stack frame is created. The creation of a new stack frame requires additional resources as well as some re-mapping of the stack, the end result is that creating new stack frames incurs a small overhead.
    Method inlining increases performance by reducing the number of method calls your program makes. The Java VM inlining code inlines methods that return constants or only access internal fields. “
    (emphasis mine) J2SE SDK 1.4.2_02 Chapter 8 Continued: Performance Features and Tools

    Also, I’d make sure that the worst bottleneck of the software actually is < insert whatever you feel is “slow”, in this case using accessors within a class >. IMHO, premature optimization is bad, optimizing by guess is even worse, so try to profile and measure that the bottleneck actually is where you think it is, before trying to fix it.

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

Sidebar

Related Questions

I'm wondering if using generic types through out the program will have any (significant)degrading
I know about the AVAudioRecorder class, but I am wondering how (using Monotouch) you
I am learning about using the checkmark cell accessory and am wondering why the
I am wondering about using the abstraction in Zend Db RowSet instead of joins,
I was wondering if using indexes on a model was possible: class Buildings(models.Model): island
Hello I was wondering if using the android tone generator class would it be
Wondering about using gzipped resources for my iOS app. The idea is to unzip
Just was wondering when using this with MySQL does it produce any errors like
I was wondering about using or not templates, in other thread I found out
i was wondering - when using jQuery (or any other javascript include) in my

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.