[jira] Created: (LUCENE-2695) DisjunctionMaxScorer allocates 2 arrays per scored doc

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (LUCENE-2695) DisjunctionMaxScorer allocates 2 arrays per scored doc

JIRA jira@apache.org
DisjunctionMaxScorer allocates 2 arrays per scored doc
------------------------------------------------------

                 Key: LUCENE-2695
                 URL: https://issues.apache.org/jira/browse/LUCENE-2695
             Project: Lucene - Java
          Issue Type: Improvement
            Reporter: Michael McCandless
            Assignee: Michael McCandless
             Fix For: 3.1, 4.0


It has this:
{noformat}
  @Override
  public float score() throws IOException {
    int doc = subScorers[0].docID();
    float[] sum = { subScorers[0].score() }, max = { sum[0] };
    int size = numScorers;
    scoreAll(1, size, doc, sum, max);
    scoreAll(2, size, doc, sum, max);
    return max[0] + (sum[0] - max[0]) * tieBreakerMultiplier;
  }
{noformat}

They are thread-private arrays so possibly/likely JVM can optimize this case (allocate only on the stack) but still I think instead it should have private instance vars for the score/max.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (LUCENE-2695) DisjunctionMaxScorer allocates 2 arrays per scored doc

JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/LUCENE-2695?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless updated LUCENE-2695:
---------------------------------------

    Attachment: LUCENE-2695.patch

Simple patch... I'll commit shortly.

> DisjunctionMaxScorer allocates 2 arrays per scored doc
> ------------------------------------------------------
>
>                 Key: LUCENE-2695
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2695
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 3.1, 4.0
>
>         Attachments: LUCENE-2695.patch
>
>
> It has this:
> {noformat}
>   @Override
>   public float score() throws IOException {
>     int doc = subScorers[0].docID();
>     float[] sum = { subScorers[0].score() }, max = { sum[0] };
>     int size = numScorers;
>     scoreAll(1, size, doc, sum, max);
>     scoreAll(2, size, doc, sum, max);
>     return max[0] + (sum[0] - max[0]) * tieBreakerMultiplier;
>   }
> {noformat}
> They are thread-private arrays so possibly/likely JVM can optimize this case (allocate only on the stack) but still I think instead it should have private instance vars for the score/max.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (LUCENE-2695) DisjunctionMaxScorer allocates 2 arrays per scored doc

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/jira/browse/LUCENE-2695?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless resolved LUCENE-2695.
----------------------------------------

    Resolution: Fixed

> DisjunctionMaxScorer allocates 2 arrays per scored doc
> ------------------------------------------------------
>
>                 Key: LUCENE-2695
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2695
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 3.1, 4.0
>
>         Attachments: LUCENE-2695.patch
>
>
> It has this:
> {noformat}
>   @Override
>   public float score() throws IOException {
>     int doc = subScorers[0].docID();
>     float[] sum = { subScorers[0].score() }, max = { sum[0] };
>     int size = numScorers;
>     scoreAll(1, size, doc, sum, max);
>     scoreAll(2, size, doc, sum, max);
>     return max[0] + (sum[0] - max[0]) * tieBreakerMultiplier;
>   }
> {noformat}
> They are thread-private arrays so possibly/likely JVM can optimize this case (allocate only on the stack) but still I think instead it should have private instance vars for the score/max.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]