This discussion is archived
1 2 Previous Next 23 Replies Latest reply: Dec 6, 2012 1:07 PM by aksarben Go to original post RSS
  • 15. Re: Java Running Program Slower Than Partner
    800268 Expert
    Currently Being Moderated
    973522 wrote:
    What we discovered is that my partner's prints finished way before mine (at least 1.5 seconds), however during the calculation, mine caught up a significant amount and only finished a split second afterwards. So I then tried commenting out the system functions in our project, but to no avail. My project still ran poorly.
    Sounds like you're running the -server JVM (slower start, tries to optimize more) while your partner runs the -client JVM (prefers faster start time). Another option is 32vs64 bit.
    Type java -version at the command line to see which one is used by default.
  • 16. Re: Java Running Program Slower Than Partner
    rp0428 Guru
    Currently Being Moderated
    Well I, for one, am done with you so good luck with your problem. You just totally refuse to provide the information that multiple responders have ask for. You are beyond help because you don't really want help; all you want to do is complain about your problem and keep insisting that it can't possibly be anything that the symptoms tell you it must be.

    You seem to have already determined what things can and cannot contribute to the problem. And you've somehow done it without actually testing much of anything.

    So that others that find this thread and learn from you here is a brief summary of YOUR findings.
    >
    I added it to Dropbox for my partner to download and check out, and when he ran it, he got a time of 0.5 seconds. Same exact code.
    . . .
    I'm using an Alienware computer and my partner has the Mac, but the difference should never be that huge.
    . . .
    This is basically a brand new computer I'm using and my partner is using a Mac. There's no reason why I should be getting that big of a difference in run time. I have better components in my computer
    . . .
    I know it's not an issue of the timer being started incorrectly
    . . .
    Again, I'm just kind of baffled about this, and I don't think it's simply a problem of having different systems.
    . . .
    If I have the latest version of Java, why would it matter what my partner has if his program is executing more quickly than mine?
    . . .
    my version of java is 1.7.0_09 and my partners is 1.7.0_06. So yes, the update version is different, but it shouldn't matter unless Java's new version somehow doesn't work as efficiently.
    . . .
    >
    Drastically different timings, same code, different hardware, different Java versions.

    You have ruled out ALL of those things as contributing to the problem. And you did it without actually doing ANY TESTING or examining the startup configuration and parameters of Java.

    That would be an amazing feat of accomplishment were it not for the fact that you haven't made any progress towards finding the problem.

    I thing gimbal2 was right: it can only be the position of the stars.
  • 17. Re: Java Running Program Slower Than Partner
    baftos Expert
    Currently Being Moderated
    My take on OP's attitude is a brighter one. Here is someone who has solved his assignment and is sincerely interested to find out more. This is rather uncommon these days. His methodology is wrong, but I commend him for trying hard to understand why it happens.
    I would not bother too much myself, but if you want to know why this happens, write a CPU bound test, compare, write a file IO test, compare, write a graphic intensive test (if you have a GUI in ths program), compare. Find where is the bottleneck and take it from there. I hope you can return your 'brand new' PC and buy a Mac instead. By the way, as a true computer geek, I would use C, not java in all the above experiments. If your hardware/OS are still performing better than your partner's, I would conclude it's the JRE. There is no reason to belive a newer JRE is more efficient than an old one. The mandate of newer JRE versions is not exclusively speed, but solving all kind of issues, sometimes at the detriment of speed. The mandate of newer languages like Java is not to speed things up. They usually slow things down as compared to, let's say... assembler.
  • 18. Re: Java Running Program Slower Than Partner
    jschellSomeoneStoleMyAlias Expert
    Currently Being Moderated
    973522 wrote:
    No. The reading of the file is separate. Only the algorithm and calculations are timed. We both copied a large file. Mine executed more quickly. However, I made 3 tests in Java. In one, I printed a word a million times. In another, printed, and then calculated pi/4 a billion times. In the last test, I included the System.currentTimeMillis().
    That takes time.
    What we discovered is that my partner's prints finished way before mine (at least 1.5 seconds), however during the calculation, mine caught up a significant amount and only finished a split second afterwards. So I then tried commenting out the system functions in our project, but to no avail. My project still ran poorly.

    I don't mean to be a nuisance, but I'm just concerned with the fact that my computer seems to be performing poorly in java. I've ran Intel processor diagnostics that pass fine. My computer runs games smoothly. I know it's extremely difficult to come to any conclusion without being able to see everything, but I'm really just stuck. My computer's performance does not seem to be affected, as far as I can tell.
    You are jumping to conclusions and ignoring other possibilities.

    Could there be something wrong with your computer? Yes.
    Have you eliminated other possibilities? No.

    You can create other timing tests and localize the problem.
  • 19. Re: Java Running Program Slower Than Partner
    976525 Newbie
    Currently Being Moderated
    Walter Laan wrote:
    Sounds like you're running the -server JVM (slower start, tries to optimize more) while your partner runs the -client JVM (prefers faster start time). Another option is 32vs64 bit.
    Type java -version at the command line to see which one is used by default.
    I checked both things, and we are both running the 64-bit server VM. Either way this should not matter since the timer is not checking the total time from start to finish. Rather, it is checking the point when the algorithm method is called in the main and when it finishes and returning the total time that took.
    rp0428 wrote:
    Well I, for one, am done with you so good luck with your problem. You just totally refuse to provide the information that multiple responders have ask for. You are beyond help because you don't really want help; all you want to do is complain about your problem and keep insisting that it can't possibly be anything that the symptoms tell you it must be.

    You seem to have already determined what things can and cannot contribute to the problem. And you've somehow done it without actually testing much of anything.

    I thing gimbal2 was right: it can only be the position of the stars.
    The fact that you went out of the way to write all of that, quoting things I said to make yourself look cool maybe, just to express your frustration with your own immaturity really astounds me. Yes, because I would seek out the Oracle forums to make an account to go complain about my own problems and then not want to do anything about it. That makes so much sense. I have never met more disrespectful and less helpful people on a help forum in my life. If you're frustrated, that's cool. Keep that to yourself and stop responding. I'm not going to spam the thread or anything. If you actually care to respond with something helpful, then be my guest. You asked
    rp0428 wrote:
    So can you explain why you still haven't

    1. posted ANY information about the versions of Java being used on each machine

    2. executed any tests on your machine that use EXACTLY the same version of Java that the other machine is using.
    And I answered with those responses accordingly. I'm glad your done though. It'll be a relief to not hear anymore complaints and senseless whining while I do everything in my knowledge to try to learn more.
    baftos wrote:
    My take on OP's attitude is a brighter one. Here is someone who has solved his assignment and is sincerely interested to find out more. This is rather uncommon these days. His methodology is wrong, but I commend him for trying hard to understand why it happens.
    Thank you for seeing a different side of this. If my methodology is wrong, please inform me so I can learn more and know what to do.
    baftos wrote:
    I would not bother too much myself, but if you want to know why this happens, write a CPU bound test, compare, write a file IO test, compare, write a graphic intensive test (if you have a GUI in ths program), compare. Find where is the bottleneck and take it from there. I hope you can return your 'brand new' PC and buy a Mac instead. By the way, as a true computer geek, I would use C, not java in all the above experiments. If your hardware/OS are still performing better than your partner's, I would conclude it's the JRE. There is no reason to belive a newer JRE is more efficient than an old one. The mandate of newer JRE versions is not exclusively speed, but solving all kind of issues, sometimes at the detriment of speed. The mandate of newer languages like Java is not to speed things up. They usually slow things down as compared to, let's say... assembler.
    I would definitely do it in C for a project like this, but the thing is that it was mandated to be programmed in Java for the class. I've done a lot of testing in Java for this project seeing as I needed to complete it successfully, examining the project itself and then the other arbitrary tests I stated earlier. That's interesting you say that the new one could be slower. I never would have thought that. But if you think not to worry about it too much because of this, maybe it'll be less of a deal somehow with later projects. I guess I'll find out in the near future with other classes or tasks I decide to take on.
  • 20. Re: Java Running Program Slower Than Partner
    Tolls Journeyer
    Currently Being Moderated
    973522 wrote:
    Walter Laan wrote:
    Sounds like you're running the -server JVM (slower start, tries to optimize more) while your partner runs the -client JVM (prefers faster start time). Another option is 32vs64 bit.
    Type java -version at the command line to see which one is used by default.
    I checked both things, and we are both running the 64-bit server VM. Either way this should not matter since the timer is not checking the total time from start to finish. Rather, it is checking the point when the algorithm method is called in the main and when it finishes and returning the total time that took.
    Without actually seeing the code I still wouldn't rule out the "how".
    How you are timing this (that is).
    But that's just me. I always assume I've buggered something up first before moving on to other things. 9 times out of 10 I'm right...:)

    And the server is slower because it optimizes as it goes.
    "Startup" covers optimisation during runtime, which will effect the timings.
    It's one of the reasons for "warming up" a performance test.
  • 21. Re: Java Running Program Slower Than Partner
    976525 Newbie
    Currently Being Moderated
    Ohh, gotcha. That makes sense. And I would normally be happy to post the code if it were not for the class I'm currently taking. Since we're still using that code for our final project, you have to always be wary of people calling that cheating.
  • 22. Re: Java Running Program Slower Than Partner
    jschellSomeoneStoleMyAlias Expert
    Currently Being Moderated
    973522 wrote:
    I have never met more disrespectful and less helpful people on a help forum in my life.
    One can't say anything about that since it is your experience but there are definitely places that can be less helpful.
    please inform me so I can learn more and know what to do.
    It really depends on your desire, needs and ability.

    Someone can certainly localize performance problems to determine the exact difference between the two environments.

    However that requires.
    1. That the time is taken to do just that.
    2. That there is reasonable access to both environments.
    3. That one has the experience needed to figure out how to localize the problem within the code base.
    4. One has the experience needed to avoided making mistakes in the above process which might lead to false conclusions.
    5. Understanding that the steps above are required and magical instatenous solutions do not exist (that follows from 3/4)

    One learns the above by attempting and normally failing (or at least not succeeding well) initially. But one must still start.
    I would definitely do it in C for a project like this,
    In general the only way one can succeed in avoiding performance problems in ANY language is by having experience both in implementation and design. And realistically the only way to avoid performance problems with any technology is either by luck or by having had experience with it before. Again one can only gain the experience by doing it.
  • 23. Re: Java Running Program Slower Than Partner
    aksarben Journeyer
    Currently Being Moderated
    At the risk of suggesting the obvious, have you run profilers against the two instances? May or may not help, but sometimes these turn up interesting data.
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points