Results 1 to 8 of 8
  1. #1
    sandeep43 is offline Member
    Join Date
    May 2011
    Posts
    97
    Rep Power
    0

    Default How to increase performance?

    Hi guys,

    I am using NetBeans for development, i have a combo box for which i am populating data from code, where it will fetch data from a sql table and add it via code and display in my UI, but this process is taking very long time to show values. How can i increase performance so that it displays values fast.

    I have nearly 30 values to show up as off now, but in real time it will be less than 10 or 15 max.

    Regards
    Sandeep

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,334
    Blog Entries
    7
    Rep Power
    20

    Default

    Write a better algorithm?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    JeffGrigg is offline Member
    Join Date
    Aug 2011
    Posts
    95
    Rep Power
    0

    Default

    Not much can be done about Java startup time.

    The time it takes to connect to a relational database can be mitigated by connecting once and reusing the connection over time.

    But usually performance issues for such a trivial amount of data are caused by a bad execution plan with your SQL and relational database. Check to see how long the SQL statement(s) take to execute. Assuming that this is the problem... Do your tables have any indexes? Work with your local Database Administrator (DBA) to optimize the performance of your SQL.

  4. #4
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,334
    Blog Entries
    7
    Rep Power
    20

    Default

    I stick by my first suggestion: write a better algorithm because if retrieving and displaying 30 values takes a 'very long time' there's something severly wrong in your code.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

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

    Default

    I like the idea of being asked to improve the performance of a (largely) unspecified piece of code.

    My car doesn't go fast enough, can anyone make it go faster?
    To which the answer could be "stand on the accelerator", "change gear", or even "don't leave the handbrake on".

  6. #6
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,334
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by Tolls View Post
    I like the idea of being asked to improve the performance of a (largely) unspecified piece of code.

    My car doesn't go fast enough, can anyone make it go faster?
    To which the answer could be "stand on the accelerator", "change gear", or even "don't leave the handbrake on".
    It's strange: you need a drivers licence to legally drive a car but you don't need anything to play with a computer and ask preposterous questions at any forum ... Sometimes I'd like to call for a revolt. Some people are simply not made for the job ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  7. #7
    JeffGrigg is offline Member
    Join Date
    Aug 2011
    Posts
    95
    Rep Power
    0

    Default

    Quote Originally Posted by JosAH View Post
    It's strange: you need a drivers licence to legally drive a car but you don't need anything to play with a computer and ask preposterous questions at any forum ... Sometimes I'd like to call for a revolt. ...
    1. It's unlikely that anyone will get anyone killed by writing code that doesn't even compile. ;->

    2. With cars, sometimes the answer is, "It works better if you start the engine, and put it in gear." ;->

  8. #8
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,334
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by JeffGrigg View Post
    1. It's unlikely that anyone will get anyone killed by writing code that doesn't even compile. ;->
    Just wait until they use the Deranged Mutant Killer Ninja Compiler! <diabolical laughter/>

    kind regards,

    Jos ;-)
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. How to print three digits in an increase.
    By AlfieSDK in forum Java Applets
    Replies: 2
    Last Post: 04-18-2011, 02:26 PM
  2. increase array size
    By giorgi in forum New To Java
    Replies: 45
    Last Post: 04-08-2011, 04:56 PM
  3. How to increase whitespace?
    By Cylab in forum New To Java
    Replies: 4
    Last Post: 08-09-2010, 08:00 PM
  4. why the number will not increase?
    By rayda in forum New To Java
    Replies: 3
    Last Post: 03-16-2009, 05:47 AM

Posting Permissions

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