Why is java slower than C and C++

Hi Guys:
I would like to know why Java is slower than C and C++ in terms of compilation speed...
Does it have to do with the fact that Java compiles to byte code first and then the JVM translates byte code to machine code which your processor can understand. whereas C and C++ compiles directly to machine code...
Any ideas on that,...let me know..

It's not necessarily. I would suggest that it always is; whencomparing
specific tasks.I would suggest that is never is (significantly)
when non-trivial and non-specialized applicationsare
involved. Requirements and design always have a
much greater impact.There's no doubt that the design is the most
important
aspect when writing a program, but assuming those
things
are equal, the fact is that a c program will be
faster.Yes, but given the fact that there is almost zero chance that the requirements, design and implementation will be optimal, it means that the real differences between the languages are insignificant compared to the real difference caused by the other factors.
In the theorectical world C/C++ is faster. In the real world, most of the time, it is not significant.

Similar Messages

  • Leopard much slower than Tiger and buggy

    Hi,
    I run Leopard on PBG4(1.67MHz) with 1GB of ram and iMAC G5(2.1) with 1.5GB of ram and I am experiencing incredibly poor performance.
    Booth machines are slower than usual and I cannot find reasons why. On my PB I am constantly getting spinning beach-ball and interestingly my fans are running all the time. Something that was not the case with Tiger. Importantly: I did not install any new SW. I use only MS Office and iWork/iLife.
    When I did a little bit of investigation I found out that Safari is taking up a lot of processing time. Even when is idle it takes up to 40%-50% of CPU time. And that is the case with PB and iMac.
    Furthermore I have encountered strange behaviour with PowerPoint and Excell and here is one line from console.log:
    5.11.07 13:14:58 [0x0-0x49049].com.microsoft.Excel[591] Mon Nov 5 13:14:58 Jabucek.local Excel[591] <Error>: The function `CGPDFDocumentGetMediaBox' is obsolete and will be removed in an upcoming update. Unfortunately, this application, or a library it uses, is using this obsolete function, and is thereby contributing to an overall degradation of system performance. Please use `CGPDFPageGetBoxRect' instead.
    Are we having serious problems with Leopard? Was this product premature to be released on the market? I am seriously thinking to downgrade back to Tiger.
    Do you have any similar experiences?
    Matej

    Hi,
    I only came to this thread because I was searching for items on a similar Console message:
    "/System/Library/CoreServices/SystemUIServer.app/Contents/MacOS/SystemUIServer: The function CGSDictionary is obsolete and will be removed in a Tiger update. Unfortunately, this app, or a library it uses, is using this obsolete function, and is thereby contributing to an overall degradation of system performance."
    As you can see, I'm still running Tiger - and I'm worried that installing Leopard will not make this odd message go away - It and another two with a similar message are generated everytime I start up..

  • Morning. I download podcast on my iMac and listen to them on my iPhone. Since last week the iPhone plays the podcast back slower than recorded and with a echo. How can I solve this?  Regards,  Menno

    morning. I download podcast on my iMac and listen to them on my iPhone. Since last week the iPhone plays the podcast back slower than recorded and with a echo. How can I solve this?
    Regards,
    Menno

    Hello,
    If you're in a country where there's an apple shop (unfortunately not mine), go check it and ask the employee about it: he's gonna check your Iphone on a "device"
    I've got an iphone 5 and it's working very well with me but I have to admit that its battery lasts (slower) than my Ipad 2.
    Still i can help with some tips that may improve your iohone's battery by an hour in addition (hopefully):
    - close all apps by multitasking....
    - do NOT keep the brightness to the max
    Believe me you're gonna regret changing your phone to a samsung
    Hope i've helped and sorry for my bad english (has english as 3rd language)

  • Why does my Mac hang at some point? The startup is slower than usual and sometime's the graphic glitches occur. please help!

    My mountain lion OS hangs like windows does and sumtimes have visual glitches like the drop down menu's are half visible. Sometimes it slows down at every point. And its just 2 months old. Please help.

    Isolating Issues
    Do a backup, using either Time Machine or a cloning program, to ensure files/data can be recovered. Two backups are better than one.
    Try a restart.
    Run Disk Utility/Repair Permissions. Run until it reports no errors. If there is a recurring error, see the article on what permission errors can be ignored.
    Disk Utility                                                       
    Disk Utility Repair Permissions You Can Safely Ignore
    Try setting up another admin user account to see if the same problem continues. If Back-to-My Mac is selected in System Preferences, the Guest account will not work. The intent is to see if it is specific to one account or a system wide problem. This account can be deleted later.
    Isolating an issue by using another user account
    If the problem is still there, try booting into the Safe Mode.  Shut down the computer and then power it back up. Immediately after hearing the startup chime, hold down the shift key and continue to hold it until the gray Apple icon and a progress bar appear. The boot up is significantly slower than normal. This will reset some caches, forces a directory check, and disables all startup and login items, among other things. If the system operates normally, there may be 3rd party applications which are causing a problem. Try deleting/disabling the third party applications after a restart. For each disable/delete, you will need to restart if you don't do them all at once.
    Safe Mode
    Safe Mode - About
    General information.
    Isolating issues in Mac OS X
    Troubleshooting Permission Issues
    Step by Step to Fix Your Mac
    Upgrade Nightmares  

  • Why are Tiger Connection Speeds Slower than Jaguar and PCs?

    There is no doubt in my mind that Tiger (10.4.5 and 10.4.6 in my experience) connects to the Internet at speeds which are 20-25% slower than the speeds attained in Jaguar (I have no personal experience with Panther) and by PCs.
    I have tested speeds at testmy.net and speakeasy.net on my Mac Mini running 10.4.6 (and before that 10.4.5), my iBook running 10.2.8, and my Dell Dimension 8250 running Windows XP. The iBook and Dell consistently measure 3400-3550 Kbps on a wireless connection to a LinkSys router and cable modem, whereas the Mini measures 2600-2900 Kbps (and sometimes much slower.) All three computers are next to one another, connecting to the same router and cable modem.
    These results are very consistent over dozens of trials over a long period of time. They are not an aberration.
    Any explanations or fixes? I have turned off IPv6, manually entered DNS servers in TCP/IP, tweaked settings with RMAC and Cocktail, but none of it has made a lasting difference. Interestingly, I have on a very few occasions found a speedup to PC and Jaguar levels on the first speed test only, after some of the listed adjustments.
    Bob N.
    Mac Mini 1.5 GHz; iBook 900 mHz; iPod 20 GB   Mac OS X (10.4.5)  

    Im marking this as answered even though it isn't, just to get it off the list of unresolved questions, where it has gathered dust for many months.

  • Why is java slow?

    Why is java so slow? I think sun needs to make a big improvement on the speed of loading a java program/applet.!!

    It is slower because it is an interpreted language. There have been many improvements to the language from compilation and through newer JVM's that further optimize the code. It is someting you must work w/ when you use the language.

  • Anyone has any idea why KT400 is slower than KT333?

    We have heard and seen reviews that MSI KT4 Ultra is(was) slower than KT3 Ultra(2), so as other manufacturers KT400 boards. All seem to be slower than KT333.
    Anybody know why? or have read any studies on this issue?

    I have no idea, but Mobo manufacturers are rushing new products to the market to be the first with 333, 400, what's next?  My strategy is to read the reviews but wait until the board (or CPU) is sub top and buy it when the bugs have been ironed out (or well documented in fora like this) and the price has come down.  Sorry, I am Dutch!

  • Why is Fiber Slower than Regular Broadband!?

    After contacting BT to upgrade to fiber i was told that it would be slower than what i was currently getting on ASL?! i was told to contact openreach and infact the Customer Assistant i spoke to put in a question for me. They contacted me and awnsers nothing, useless.
    Why is my fiber 1.5mb and ASL 3mb and any suggestions to how i can resolve this issue!?

    Featured ProductsDownstream Line Rate(Mbps)Upstream Line Rate(Mbps)Downstream Range(Mbps)Availability Date
    WBC ADSL 2+
    Up to 3
    2.5 to 6.5
    Available
    ADSL Max
    Up to 3
    2 to 5.5
    Available
    WBC Fixed Rate
    1
    Available
    Fixed Rate
    1
    Available
    Other Offerings
    Copper Multicast
    Available
    all so slow

  • Why is Java better than c#. most people say c# is better

    I have entered forums and end up seeing informations on c# being better than java. Pls can any body tell me what makes java better than c#. This days every one i know is now going c#. They are discoraging me to also go c#.
    i am quite con fussed. The only thing that keeps me to JAVA is platform independence.

    Well, I suppose you can search Google for 'C# vs java' and read an article such as
    http://en.wikipedia.org/wiki/Comparison_of_Java_and_C_Sharp.
    However arguing which is better is best left as an exercise for developers with a lot of experience in both languages rather than those just starting out (If your just starting out, you will not use the advanced features one has over the other).
    I think the market will be evenly split between both languages for quite some time. Ideally, as a professional developer you should know both well so you are more employable. For Java, I suggest getting familiar with The Eclipse IDE since its used by the bulk of Java developers. For C#, I suggest you install Visual Studio Express because its used by the bulk of C# developers (and the express version is free).
    I suggest you first learn one or the other very very well and good coding practices before learning the other language to avoid mixing the two somewhat different coding styles.
    I suggest learning whichever language your friends are using assuming you communicate with them about programming often (so you can help each other). If instead your on your own, I suggest you learn Java. I think you will have an easier time picking up the Object Oriented philosophy than C# because in my opinion Java is more low level coding and C# is more high level coding (ie, the advanced features it can do a lot for you). You should have a good handle on the low level concepts first. In may opinion, once you know Java well, C# is a lot easier to pick up since they are both object oriented and are very similar object oriented languages.

  • Lighter Java GUI than awt and swing?

    I had recently came across a company website (http://www.bambookit.com) where they developed a java gui library without using awt and swing (seems to what they claim). And on top of that it uses xml to generate the gui components (they call widgets) and the whole library size is only 95kb and supports java 1.1.x and above. Their demos on the applets loads super fast, never know/experience that java applets can actually be this quick. But this confuses me, how is it possible to develop a gui alternative to awt with the basic java classes and no dependency on awt? But since the applets are awt based, it means that they must have some dependencies.
    This is an extract from their website (that it seemed they did not use awt)
    "Java has a fundamental flaw in its paint thread that made it very difficult to build extremely large applications without getting severe performance and resource penalties (This affects both AWT and Swing based applications). It�s main repaint queue\thread when assigning paint regions to various controls uses the Graphics objects to �clip� them. On a Sun Solaris machine this does not cause any problems, however on a windows machine each Graphics object consumes a system resource/handle, (a limit of around 16,000 exists on Win 95 and Win 98 machines). Each Bitmap image, each font object, each icon consumes a single system resource or handle. If a full repaint is performed on an application containing 1000 controls, it would consume at LEAST 1000 system resource handles. If the application was updated many times a second, lets say 10 times a second, then that equates to 10,000 handles a second. This is not taking into account labels within controls, the various fonts styles and sizes created, the various images that get loaded. This could easily exceed 20,000 system resource requests a second. Bambookit on the other hand utilizes the clip routines and passes along a SINGLE Graphics objects to all its various controls. This alone is a HUGE savings in system resources and performance."
    Two questions came to my mind:
    1) Is it possible to build applet gui without using awt and swing in java? If so the only way to do is to use JNI calls?
    2) Am I wrong in interpreting www.bambookit.com's message that they are not using awt?
    Any comments about this?
    Regards,
    Stanly

    They use AWT as basis for their drawing-layer, as any other lightweight toolkits too.
    If you just want a very fast & light alternative to swing/awt have a look at www.lwvcl.com !
    I use it for a large applet-applikation that has to be java-1.1 compatible. It was a horor when using AWT which was implemented different over all JVMs available and very slow (although native widgets were used).
    With lwvcl (which has only 150kB!) I can use state of the art applets that work very fast on modern jvms like 1.4, give me the ability to compile my applikation to native code using GCJ (using the swt-prt of the library) or distribute it to old-school 1.1 browser where it also runs quite fine...
    Its free for GPL and very cheap for commercial use.
    lg Clemens

  • Why is firefox slower than before the reset?

    The past 8 weeks Firefox has been extremely slow. I've tried safe mode and all the other web suggestions and finally did the 'Reset'. Now Firefox is slower than it was before the reset. Google, Duck Duck Go and IE. I've also tried Safari, which I didn't like, but all of them were faster than Firefox. Can anybody help me? I'm not that computer savvy to do a clean install and don't the $$ to have it done. Any suggestion would be greatly appreciated.

    Maybe you can do a clean install by following these instructions:
    '''Note:''' You might want to print these steps or view them in another browser.
    #Download the latest Desktop version of Firefox from [https://www.mozilla.org mozilla.org] (or choose the download for your operating system and language from [https://www.mozilla.org/firefox/all/ this page]) and save the setup file to your computer.
    #After the download finishes, close all Firefox windows (or open the Firefox menu [[Image:New Fx Menu]] and click the close button [[Image:Close 29]]).
    #Delete the Firefox installation folder, which is located in one of these locations, by default:
    #*'''Windows:'''
    #**C:\Program Files\Mozilla Firefox
    #**C:\Program Files (x86)\Mozilla Firefox
    #*'''Mac:''' Delete Firefox from the Applications folder.
    #*'''Linux:''' If you installed Firefox with the distro-based package manager, you should use the same way to uninstall it - see [[Installing Firefox on Linux]]. If you downloaded and installed the binary package from the [http://www.mozilla.org/firefox#desktop Firefox download page], simply remove the folder ''firefox'' in your home directory.
    #Now, go ahead and reinstall Firefox:
    ##Double-click the downloaded installation file and go through the steps of the installation wizard.
    ##Once the wizard is finished, choose to directly open Firefox after clicking the Finish button.
    More information about reinstalling Firefox can be found [[Troubleshoot and diagnose Firefox problems#w_5-reinstall-firefox|here]].
    <b>WARNING:</b> Do not use a third party uninstaller as part of this process. Doing so could permanently delete your [[Profiles|Firefox profile]] data, including but not limited to, extensions, cache, cookies, bookmarks, personal settings and saved passwords. <u>These cannot be easily recovered unless they have been backed up to an external device!</u> See [[Back up and restore information in Firefox profiles]]. <!-- Starting in Firefox 31, the Firefox uninstaller no longer lets you remove user profile data.Ref: Bug 432017 and https://support.mozilla.org/kb/uninstall-firefox-from-your-computer/discuss/5279 [Fx31] Windows uninstaller will no longer offer the option to remove personal data -->
    Please report back to say if this helped you!
    Thank you.

  • Why is firefox slower than explorer on windows 7?

    firefox runs slower than explorer in windows 7. New laptop. I notice it when switching pages while on craigslist. Does not happen on other computers running xp or vista.

    Some of your extensions might be the cause of the problem. Try starting Firefox in Safe Mode then going to Tools--Addons--Extensions to see if one of your extensions is causing a problem.
    To go into Safe Mode click on this link
    https://support.mozilla.com/en-US/kb/Safe+Mode

  • Why is Java slow or causing Lion to be slow?

    I did a fresh install of Lion and installed all the needed updates including the APPLE java update plus the malware remover that came with it. Since then a lot of Java games are SLOW. I'm not sure if it's actually java or a Lion update that's causing this issue. Someone suggested I remove my printer software but I dont remember that causing issues before the fresh install. It seems it happened after Apple updates.
    Any help is appreciated.
    Thanks

    It is slower because it is an interpreted language. There have been many improvements to the language from compilation and through newer JVM's that further optimize the code. It is someting you must work w/ when you use the language.

  • DVD Player audio track plays slower than Video and at transposed pitch

    I have a strange problem with DVD player. I have an opera DVD (not a commercial one - it is from a personal performance and is on a DVD-R disk)) which I put in my Mac Book Pro (OSX 10.5.6)and DVD Player played it fine. I wanted to try to convert the info on the DVD to extract a short section of the DVD. I went to Hand Brake and tried that, it told me I needed to install VLC which I did, Hand Brake then recoded the Files. Now when I insert the DVD though DVD Player starts automatically but plays the DVD audio at a slower speed and transposed lower. I have no idea why this is! Needless to say I do not want it playing slower. VLC also did not work very well with the audio so I have uninstalled the VLC program as it played the VOB files but the sound track was very wonky with the pitch shifting all over the place. How do I return to having DVD Player working properly?

    okay, I can help you a little bit. your dvd player (standalone) plays mpeg-2, I think, so
    in order for a disk to work in it, both the audio and video have to be combined into a whole package, which i think is video_ts.Using Toast, choose video, then dvd-video then drag n' drop, and it may work. As far as  i know, disk utility cannot make video dvd's, but  I may be wrong, and you may be right. I used iDVD, but there are probably other programs that may do as good a job of burning. Oh, and this is most important: Some blanks will work ok, and others won't. Verbatim, maxell ( I think) and Taiyo Yuden will work fine. the other ones are a gamble. I think what it's supposed to do is called muxing. I'm sure someone will correct me on this. You could try using "Burn" which is relatively cheap or Handbrake and see if that will do what you want to do. not that it's super important, but the amount of Ram in your machine is helpful too
    anyways, good luck
    John b

  • Outlook 2010 performance much slower than 2007 and 2003 when used with POP3 mail provider over slow network connection

    When received messages include embedded pictures, Outlook 2010 does not persist those pictures in the .pst file with the message text.  Instead, it redownloads the pictures every time the message is rendered for viewing or printing.
    Send/Receive to replicate a message with multiple embedded pictures from POP3 mail server (not Exchange server)
    Select and view the message - notice all the x placeholders for the embedded pictures
    Right-click any x placeholder and select to "download pictures"
    After some delay, the pictures are rendered, replacing the placeholders, to form the complete message
    Now, select "File" and "Print" -- notice that the preview is not immediately displayed.  There is a delay while thos same embedded pictures are downloaded, again.  Sometimes there will be a pop-up notification that Outlook is "communicating with
    the server"
    Eventually the message is fully rendered with all embedded pictures
    Now, select a different printer -- notice that the preview disappears and it takes time to .... yes, redownload those same pictures, again.
    Finally, click on "Print" -- notice yet another delay for a final download to rerender the message for the printer.
    Having done all that, close Outlook, disconnect from the network (turn off wireless or disconnect wire), open Outlook and view that same message.  The x placeholders are shown instead of the embedded pictures.  Although those embedded pictures
    were downloaded multiple times already, they were not persisted locally.
    Outlook 2003 and 2007 correct ask for confirmation to save the pictures locally then does so.  Printing and viewing is then possible without having to redownload those pictures.
    Is there going to be a fix for this Outlook 2010 defect?   I've been waiting, applying updates, and waiting.....

    Please do not close this thread.  The issue remains.  I apologize for not checking back sooner.  I thought I would get pinged by email when this tread was updated;  I did not.  I'll monitor more closely in the future.
    First, please note that I explicitly set Outlook to NOT download pictures automatically.  I want to be prompted to download.  However, after confirmed that I want the download, I expect pictures related to the message to be downloaded only once,
    immediately after I confirm that I want them downloaded. 
    I have confirmed many times that the behavior in this area is NOT identical between 2003, 2007 and 2010.  In particular, 2007 does download once and store locally (if user confirms to save changes when prompted), as expected, and 2010 downloads each
    view/preview/print.
    This is quite easy to verify -- simply unplug any network cable, disable wireless, etc.  In other words completely detach from the networked world.  2007 will correctly view/preview/etc. from local storage whereas 2010 always reverts to showing
    placeholders for any embedded images.  This is 100% repeatable.
    As an additional verification, simply move the .pst file to another system that is not connected to any network.  Open the .pst file with 2007 and any embedded images that were already downloaded (and saved) are there, with 2010 they are not.
    With 2010, it is bad enough that embedded images are not saved for viewing when disconnected.  Worse than that, the repeated downloads can be a significant disruption to performance.  Just get on a really slow wireless connection as is typical
    in some hotels.  Then try to view and print messages with lots of embedded pictures.  Slow takes on a whole new, even slower, meaning.
    This 2010 defect has been reproduced.  Is there a KB article, Windows Update, hotfix,.... anything available to eliminate this problem of repeated downloads of embedded pictures?

Maybe you are looking for

  • JDOM and text embedded tags

    Hi all! I've just been using JDOM for some XML parsing right now and it works really fine. But I have one problem I can't find a solution (but I think it should be possible and quite simple). Given the following XML for example: <document>   <item>  

  • HT4623 is it necessary to backup my ipad on my iphone?  Iphone is 5.4 GB ipad is 315.3MB?

    s it necessary to backup my ipad on my iphone?  Iphone is 5.4 GB ipad is 315.3MB?

  • How we can intiallize the object  state

    how we can intialize the object state without using constructor or getter setter method? is their is any way to intialize the state of object using encapsulation??

  • Enque/table_size - Changing the parameter value

    Hi folks, I'm fairly new to SAP so was hoping for a bit of guidance with this matter. I need to increase the parameter value for "enque/table_size".  It's currently set to the default 4096kb and we're seeing a lot of lock table overflow errors. As th

  • WRT160N: Wireless Works Great, Wired is Slow

    I replaced my old Linksys 8-port router with a wireless WRT160N so that my iPhone would have Wi-Fi in the house.  (AT&T network isn't great where I live.) My iPhone screams now, great connectivity.  But, my two desktops which are connected directly t