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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:52:48+00:00 2026-05-21T06:52:48+00:00

I want to know about the efficiency of Java and the advantages and disadvantages

  • 0

I want to know about the efficiency of Java and the advantages and disadvantages of Java Virtual Machine and Android.
Efficiency is the low use of memory, low use of the processor and fast execution.

Mobile devices are simpler than PC, then the apps need to be more efficient. Servers receive many connections and they need to be very efficient. Many mobile devices use Android and Java apps, and many servers use PHP.

Can Java and interpreted languages, such as Java Script, Python and PHP, be more efficient than C and C++?

JIT (just in time) advantages:

  • It can optimize better, because it knows the value of some variables and where it is used or changed.
  • It knows the processor and can optimize with processor specific instructions.
  • It is easier to transform functions into inline function.
  • It can remove known conditional tests and remove blocks that will not be run.

Java disadvantages:

  • When the app run for the first time, the app will be very slow, because the bytecodes will be interpreted and JIT compiler will do many analysis to find good optimizations. The apps cannot use the maximum of the hardware power. If an app is a game or a real-time app, if it be run for the first successfully and with no delay, but it uses the maximum of the hardware power, then the next time the app be run, it will not use the maximum of the hardware power due to optimizations. The problem is the app cannot be designed to use the maximum of the hardware power after the optimization, because it will be too slow on the first run, and will not continue to run.
  • Java checks if the array index is not out of bounds, and it checks if the pointers are not null. It will add several internal “if”s to generated code.
  • All objects use garbage collector, including objects that are very easy to manually delete.
  • All instances of objects are created with dynamic memory allocation, including objects that can easily use the stack. If a loop iteration begins creating an instance of a class and ends deleting the created object, dynamic memory allocation will be inefficient.
  • The garbage collector needs to stop the app while it cleans the memory and it is very undesired for games, GUI apps and real-time apps. Reference counting is slow and it cannot handle circular references. Multi-threaded garbage collector is slower and it needs more use of the CPU.
  • 1 1 Answer
  • 3 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-21T06:52:49+00:00Added an answer on May 21, 2026 at 6:52 am

    Can Java and interpreted languages, such as Java Script, Python and PHP, be more efficient than C and C++?

    It’s very difficult to get more efficient than the best C and C++ programs. There’s a lot of C and C++ programs that are nowhere near as efficient as that though, and beating them with (modern) Java code is quite practical if you’re any good.
    I’ve also heard good things about the current best-of-breed Javascript engines, but I’ve never studied them in detail.

    With Python and PHP (and many other languages besides) it’s a bit different. Those languages are written in C, so it’s obvious they cannot be more efficient than C (follows by construction). Yet it’s much easier to write efficient code in them (i.e., that uses what is in-effect a very well-written C library) than it is to start from scratch. In particular, it reduces the number of defects per program. That’s a very important metric in practice; anyone can produce fast code if it’s allowed to be wrong.

    In general, I advise not worrying about getting maximal efficiency. You run up against the law of diminishing returns. Instead, use sensible overall algorithms (or, as a friend of mine once said to me, “look after the big O()s and let the constant factors look after themselves”) and focus on the question of whether the program is good enough in practice. Once it is, stop fiddling around and ship it!

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

Sidebar

Related Questions

I want to know about the advantages and disadvantages of URL masking. Does it
I want to know about the possibility of an per machine install using a
I'm wondering about computational efficiency. I'm going to use Java in this example, but
please help me. I want know about what types of flags to run an
I want to know about the id3 metadata, I am eager in extracting the
I want to know about Virtualization in detail. But start from basics, like what
I want to know about the best practices here. Suppose I want to get
i just want to know about the files and folder structure for a site
im new in PHP and I want to know about PHP Zend Framework. What
Here is the wiki for those who want to know about Apache CXF. http://en.wikipedia.org/wiki/Apache_CXF

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.