Results 1 to 6 of 6
  1. #1
    oaklandsbest is offline Member
    Join Date
    Jun 2011
    Posts
    6
    Rep Power
    0

    Default Java Performance?

    I have been hearing phrases such as nlogn,O(n), etc and more for java. I'm not quite sure what this means but I know it has something to do with time/performance. Could someone explain or post a link where I can read about.

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

  3. #3
    oaklandsbest is offline Member
    Join Date
    Jun 2011
    Posts
    6
    Rep Power
    0

    Default

    For "Orders of common functions" table on that page, how would I know which notations compare against the other in terms of speed. I have heard them before used in Sorts when talking about the speeds but don't understand it really.

  4. #4
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default

    The table goes from fast to slow. (like it says!) But notice how it says "the slower growing functions are generally listed first". That's because the O() notation is defined in terms of asymptotic behaviour; we may have f(x)=O(1) and y(x)=O(n!) but still find for some specific value of n that f(n)>y(n).

  5. #5
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,431
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by oaklandsbest View Post
    For "Orders of common functions" table on that page, how would I know which notations compare against the other in terms of speed. I have heard them before used in Sorts when talking about the speeds but don't understand it really.
    Note that the big-Oh notation doesn't mention anything about speed; it is defined in terms of elementary steps, e.g. one comparison is one step, one swap operation is one step etc. Consider an efficient algorithm (in terms of those steps); it runs much faster on a fast computer than on a slow computer; both computers perform the same number of steps. Big-Oh defines the number of steps given the size of a problem, e.g. the heapsort algorithm takes O(n*log(n)) steps to sort n items (which is a lot better than bubble sort which takes O(n*n) steps).

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  6. #6
    trksoft is offline Member
    Join Date
    Jun 2011
    Posts
    1
    Rep Power
    0

Similar Threads

  1. Java Programs to Test Performance
    By testarosa in forum Advanced Java
    Replies: 4
    Last Post: 02-27-2009, 01:04 PM
  2. How can we Use SoftReference in Java for better performance
    By priyanka.dandekar in forum Advanced Java
    Replies: 1
    Last Post: 10-05-2008, 10:39 PM
  3. Java Performance Ideas
    By developer321 in forum Advanced Java
    Replies: 4
    Last Post: 06-28-2008, 04:16 PM
  4. how to improve java performance
    By sunjavaboy in forum Advanced Java
    Replies: 6
    Last Post: 06-15-2008, 05:58 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
  •