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

I have been creating object for a project and there are some instances that
There are some things that I do a lot in a new project, for
Is there some way to modify qmake project files (*.pro) such that qmake doesn't
I analyze a VB.NET project and there are some objects (child MDI form) that
i create a sample project with GWT. in my project there are some classes
So I have a project where there is some automatic initialization going on through
I am working on a project with OCaml and there are some problems regarding
I have one java project in netBeans. There are some packages, and classes in
In my current simple project, Copybin , there is some space at the bottom
I have a following situation in my project. There are some tag values which

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.