Results 1 to 17 of 17
  1. #1
    slider57 is offline Member
    Join Date
    Aug 2011
    Posts
    29
    Rep Power
    0

    Default Jar file 4 times slower than in IDE

    When I run the .jar file after I build it in netbeans, it takes at least 4 times longer to gather resources over the net. On top of that, it doesn't even gather all of the information. For example, I will run it in netbeans and it finds 8 folders and when I run it as a jar it only finds 4. I have been looking for a solution and some people have been talking about the jar using memory or something like that. Anyone know?

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,792
    Rep Power
    19

    Default Re: Jar file 4 times slower than in IDE

    The environments are different in some way (other than being a jar file vs Netbeans).
    That should be clear from the fact you;re getting very different results.
    Since we can't see what your code does, or what the environments are, that's about the limit of any help.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,655
    Rep Power
    5

    Default Re: Jar file 4 times slower than in IDE

    it takes at least 4 times longer to gather resources over the net
    What does that even mean, "over the net" ?
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  4. #4
    slider57 is offline Member
    Join Date
    Aug 2011
    Posts
    29
    Rep Power
    0

    Default Re: Jar file 4 times slower than in IDE

    Over the Internet. The environment huh, ok. I appreciate your feedback.

  5. #5
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,655
    Rep Power
    5

    Default Re: Jar file 4 times slower than in IDE

    So it is downloading stuff from the internet. Just say that then :s I'm still confused what downloading stuff from the net has anything to do with "finding folders" though, the next time you ask a question you may want to actually clarify it.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  6. #6
    slider57 is offline Member
    Join Date
    Aug 2011
    Posts
    29
    Rep Power
    0

    Default Re: Jar file 4 times slower than in IDE

    Why would you even respond if all you wanted to do was nitpick?

  7. #7
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default Re: Jar file 4 times slower than in IDE

    You will get better responses if you provide as much information about the problem as possible.
    If you don't understand my response, don't ignore it, ask a question.

  8. #8
    slider57 is offline Member
    Join Date
    Aug 2011
    Posts
    29
    Rep Power
    0

    Default Re: Jar file 4 times slower than in IDE

    Yea I should apologize for being defensive, toigh day today. If my manifest file has two lines, one thwversion number then it says x-comment main class will be added after built. Do you guys think that could be the issue for poor performance of my .jar?

  9. #9
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default Re: Jar file 4 times slower than in IDE

    Can you post the full text of the manifest file that is used to build the jar file (and is contained in the jar file)?
    Also describe the relationship between the class name on the Main-class: line with your classes.
    Is it one of your classes or did the IDE add some of its classes?

    Use a zipfile utility to look at the contents of the jar file to see if the IDE has put any classes in the jarfile besides your files.
    If you don't understand my response, don't ignore it, ask a question.

  10. #10
    slider57 is offline Member
    Join Date
    Aug 2011
    Posts
    29
    Rep Power
    0

    Default Re: Jar file 4 times slower than in IDE

    Manifest in the jar file:
    Manifest-Version: 1.0
    JavaFX-Version: 2.2
    implementation-vendor: James
    implementation-title: HansardMain
    implementation-version: 1.0
    JavaFX-Application-Class: hansardmain.HansardMain
    JavaFX-Class-Path: lib/dom4j-1.5.jar lib/json-20080701.jar lib/jsr173_
    1.0_api.jar lib/poi-3.8-20120326.jar lib/poi-ooxml-3.8-20120326.jar l
    ib/poi-ooxml-schemas-3.8-20120326.jar lib/resolver.jar lib/xbean.jar
    lib/xbean_xpath.jar lib/xmlbeans-qname.jar lib/xmlpublic.jar
    Created-By: JavaFX Packager
    Main-Class: com/javafx/main/Main

    Manifest file NOT contained in JAR:
    Manifest-Version: 1.0
    X-COMMENT: Main-Class will be added automatically by build

    The main-class in the jar file is not one of mine. My main class is D:\Documents\HansardMain\src\hansardmain\HansardMa in.java

    There is a com folder that contains main.class and nojavafxclassfallback.class
    Something interesting is that there are at least two files of the same class in the hansardmain folder packaged in the jar
    and up to 6 files of the same class for some of them. All those files are different sizes, but not by much.

    I never knew all that was packaged into my JAR. The more you know (with a rainbow overhead). Anything else you need?
    Last edited by slider57; 09-18-2013 at 05:21 AM.

  11. #11
    slider57 is offline Member
    Join Date
    Aug 2011
    Posts
    29
    Rep Power
    0

    Default Re: Jar file 4 times slower than in IDE

    that last post is having some character issues, I cant read it.

  12. #12
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,792
    Rep Power
    19

    Default Re: Jar file 4 times slower than in IDE

    Quote Originally Posted by slider57 View Post
    Something interesting is that there are at least two files of the same class in the hansardmain folder packaged in the jar
    and up to 6 files of the same class for some of them. All those files are different sizes, but not by much.
    If they end in $1 or $<a number> then they are anonymous classes defined in the parent class code.

    Quote Originally Posted by slider57 View Post
    I never knew all that was packaged into my JAR. The more you know (with a rainbow overhead). Anything else you need?
    Yes.
    What is it you are doing?
    How are you determining performance?
    Does the code do the same thing in Netbeans as it does in the jar file?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  13. #13
    slider57 is offline Member
    Join Date
    Aug 2011
    Posts
    29
    Rep Power
    0

    Default Re: Jar file 4 times slower than in IDE

    --I search a websites json script for specific people or topics relating to the UK's parliament.
    --I determine the speed by just how long the program takes to completes when executing the jar and executing it in the ide.
    -- im not sure I understand your last question. The output is not the same when running it in the ide as in the jar. As the program searches through the json script itll pick out information to store locally and I get different results when running it between the two methods.

    if you'd like I can send you the program to look over but its like 20MB. If you want to do it that way ill give you credit in the program for editing/debugging.

    P.S. - this is the first program I have published so I'm very much a novice.
    Last edited by slider57; 09-18-2013 at 10:41 PM.

  14. #14
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default Re: Jar file 4 times slower than in IDE

    I get different results when running it between the two methods.
    That does not make sense. There must be something it is doing differently in its searches to get different results.

    Do you have a testing HTTP server that you could use to test the program? If the server had some debugging capability, maybe you could see what is different between executing from the jar and the IDE.
    If you don't understand my response, don't ignore it, ask a question.

  15. #15
    slider57 is offline Member
    Join Date
    Aug 2011
    Posts
    29
    Rep Power
    0

    Default Re: Jar file 4 times slower than in IDE

    Im sure netbeans has some type of functionality for that but ive never used it before. I guess I could look into that. Honestly, this problem totally baffles me. I moved the program itself closer to the root of the drive arbitrarily and it downloaded everything that it was suppose to. The java gods must not like me.

  16. #16
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,792
    Rep Power
    19

    Default Re: Jar file 4 times slower than in IDE

    Got to be something to do with how you're doing IO then, or at least interacting with the underlying file system.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  17. #17
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default Re: Jar file 4 times slower than in IDE

    Try profiling to see where the code is spending its time when executing. The java command's -Xprof option is one way to get a profile.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Replies: 0
    Last Post: 03-23-2012, 10:13 PM
  2. Numeric range query way slower (3.5 vs 3.1)
    By tinwelint in forum Lucene
    Replies: 1
    Last Post: 01-09-2012, 04:00 PM
  3. Replies: 8
    Last Post: 03-12-2010, 04:30 PM
  4. Replies: 1
    Last Post: 07-14-2009, 07:04 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •