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

  • Home
  • SEARCH
  • 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 79645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T21:10:42+00:00 2026-05-10T21:10:42+00:00

I was curious if anyone had any hard numbers around the performance difference between

  • 0

I was curious if anyone had any hard numbers around the performance difference between annotating Entities using private fields instead of public getter methods. I’ve heard people say that fields are slower because they’re called ‘through reflection’ but then again so are the getter methods, no? Hibernate needs to set the accessibility of the field to true before it tries to read it which I can see having some slight overhead. However wouldn’t that be done at the Class-level in the scope of a Session or perhaps only once when the Configuration is read and SessionFactory is built?

Just curious if this is a myth or if there’s really truth to it; I personally find annotating the fields to be a bit more readable.

  • 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. 2026-05-10T21:10:42+00:00Added an answer on May 10, 2026 at 9:10 pm

    Loaded 5000 records into a simple 3 column table. Mapped two classes to that table, one using annotated private fields and another using annotated public getters. Ran 30 runs of Spring’s HibernateTemplate.loadAll() followed by a HibernateTemplate.clear() to purge the Session cache. Results in ms below…

    methods total: 6510, average: 217

    fields total: 6586, average: 219

    I should probably take another stab at it after adding more properties to each class but right now the difference doesn’t appear to be statistically significant.

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

Sidebar

Ask A Question

Stats

  • Questions 61k
  • Answers 61k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer I recommend using Watir, a ruby library designed for browser… May 11, 2026 at 9:51 am
  • added an answer Sounds plausible that DNS is your bottleneck. Try making the… May 11, 2026 at 9:51 am
  • added an answer In terms of memory management, these two classes are virtually… May 11, 2026 at 9:51 am

Related Questions

I was curious if anyone had any hard numbers around the performance difference between
I was curious if anyone had any problems creating unit tests around using the
I was curious if anyone had any suggestions on a Java library that provides
I was curious if anyone out there has experience getting the necessary legal documents
I was curious if there's a .Net API that would allow me to identify
Quick question, I was curious if there is any difference between a database table
I was curious about how other people use the this keyword. I tend to
I was curious as to what other shops are doing regarding base application frameworks?
I was curious what the differences are between the debug and release modes of
I am fairly new to Rails and I was curious as to some of

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.