Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-7215

don't invoke full haversin for LatLonPoint.newDistanceQuery

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.1, 7.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      For tree traversals and edge cases we still sometimes invoke full haversin (with asin() call and everything). this is not necessary: we just need to compute the exact sort key needed for comparisons.

      While not a huge optimization, its obviously less work and keeps the overhead of the BKD traversal as low as possible. And it removes the slow asin call from any hot path (its already done for sorting too), with its large tables and so on.

        Activity

        Hide
        rcmuir Robert Muir added a comment -

        Here is a patch. I see these numbers (i ran 10 iterations x 3 jvms for each and numbers are consistent):

        2D distance with no filter: 33.7 QPS -> 35.4 QPS
        2D distance with 0.0001% filter: 53.0 QPS -> 58.0 QPS

        Show
        rcmuir Robert Muir added a comment - Here is a patch. I see these numbers (i ran 10 iterations x 3 jvms for each and numbers are consistent): 2D distance with no filter: 33.7 QPS -> 35.4 QPS 2D distance with 0.0001% filter: 53.0 QPS -> 58.0 QPS
        Hide
        mikemccand Michael McCandless added a comment -

        +1, cool

        Show
        mikemccand Michael McCandless added a comment - +1, cool
        Hide
        kwright@metacarta.com Karl Wright added a comment -

        Interesting how sensitive the performance is to this one change.

        Show
        kwright@metacarta.com Karl Wright added a comment - Interesting how sensitive the performance is to this one change.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 2335a458d8340bbb8e4fe8133a74763bd2d37fd1 in lucene-solr's branch refs/heads/master from Robert Muir
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=2335a45 ]

        LUCENE-7215: don't invoke full haversin for LatLonPoint.newDistanceQuery

        Show
        jira-bot ASF subversion and git services added a comment - Commit 2335a458d8340bbb8e4fe8133a74763bd2d37fd1 in lucene-solr's branch refs/heads/master from Robert Muir [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=2335a45 ] LUCENE-7215 : don't invoke full haversin for LatLonPoint.newDistanceQuery
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 87069500fb2e56b4ceabadb8bb866be39e4269fb in lucene-solr's branch refs/heads/branch_6x from Robert Muir
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=8706950 ]

        LUCENE-7215: don't invoke full haversin for LatLonPoint.newDistanceQuery

        Show
        jira-bot ASF subversion and git services added a comment - Commit 87069500fb2e56b4ceabadb8bb866be39e4269fb in lucene-solr's branch refs/heads/branch_6x from Robert Muir [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=8706950 ] LUCENE-7215 : don't invoke full haversin for LatLonPoint.newDistanceQuery
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 2335a458d8340bbb8e4fe8133a74763bd2d37fd1 in lucene-solr's branch refs/heads/jira/SOLR-8908 from Robert Muir
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=2335a45 ]

        LUCENE-7215: don't invoke full haversin for LatLonPoint.newDistanceQuery

        Show
        jira-bot ASF subversion and git services added a comment - Commit 2335a458d8340bbb8e4fe8133a74763bd2d37fd1 in lucene-solr's branch refs/heads/jira/ SOLR-8908 from Robert Muir [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=2335a45 ] LUCENE-7215 : don't invoke full haversin for LatLonPoint.newDistanceQuery
        Hide
        hossman Hoss Man added a comment -

        Manually correcting fixVersion per Step #S5 of LUCENE-7271

        Show
        hossman Hoss Man added a comment - Manually correcting fixVersion per Step #S5 of LUCENE-7271

          People

          • Assignee:
            Unassigned
            Reporter:
            rcmuir Robert Muir
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development