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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:44:26+00:00 2026-05-13T22:44:26+00:00

In my project there are some ‘Prototype’ factories that create instances by cloning a

  • 0

In my project there are some ‘Prototype’ factories that create instances by cloning a final private instance.

The author of those factories says that this pattern provides better performance than calling ‘new’ operator.

Using google to get some clues about that, I did not found anything relevant.
Here is a small excerpt found in a javdoc from an unknown project

Sadly, clone() is rather slower than
calling new. However it is a lot
faster than calling
java.lang.Class.newInstance(), and
somewhat faster than rolling our own
“cloner” method.

For me it’s looking like an old best practice of the java 1.1 time.
Does someone know more about this ? Is this a good practice to use that with ‘modern’ jvm ?

  • 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-13T22:44:26+00:00Added an answer on May 13, 2026 at 10:44 pm

    Absolutely, this type of practice is completely obsolete. The Java virtual machine has improved drastically since then. Object creation is extremely cheap. Another related practice, Object Pooling, is also obsolete because the cost of Object creation and cleanup is so much more efficient now. For some cases it might be useful (Jon Skeet gives some good examples here), but in no way should it be part of a base framework library such as this.

    I would suggest finding some new libraries and/or a new project to work on 😉

    Check out this class article Java Urban Performance Legends for some more insight.

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

Sidebar

Related Questions

Is there some way to transform/project XML from an XML column in the select
This is my first project that i need to use some database ( using
Is there some module to allow for easy DB provider configuration via connection string,
Due to some project, I need to work on Galaxy Tab Emulator on my
Is there any way to generate a list of classes in a Java project
we have database with some table-valued functions writen in C#. I have database project
I've started to refactor/clean up big project. Some of files contains few small classes
I've been a PHP developer but recently need to work on some project using
For testing purposes, I often start typing some code in an already existing project.
For some reason, the drawables in my app are blurry. This is especially apparent

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.