hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Todd Lipcon (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-3976) SampleQuantiles#query is O(N^2) instead of O(N)
Date Tue, 25 Sep 2012 23:12:07 GMT

    [ https://issues.apache.org/jira/browse/HDFS-3976?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13463330#comment-13463330
] 

Todd Lipcon commented on HDFS-3976:
-----------------------------------

While you're at it, why not get rid of size() and numeric iteration too?

eg:
{code}
for (SampleItem item : samples) {
  if (prev == null) {
    prev = item;
    continue;
  }
  ...

  prev = item;
}
{code}
                
> SampleQuantiles#query is O(N^2) instead of O(N)
> -----------------------------------------------
>
>                 Key: HDFS-3976
>                 URL: https://issues.apache.org/jira/browse/HDFS-3976
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>    Affects Versions: 2.0.3-alpha
>            Reporter: Andrew Wang
>            Assignee: Andrew Wang
>            Priority: Minor
>         Attachments: hdfs-3976-1.patch
>
>
> SampleQuantiles#query() does O(N) calls LinkedList#get() in a loop, rather than using
an iterator. This makes query O(N^2), rather than O(N).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message