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

MinFloatFunction / MaxFloatFunction calls exists twice

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 9.2
    • None
    • None
    • New

    Description

      MinFloatFunction (https://github.com/apache/lucene/blob/main/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/MinFloatFunction.java) and MaxFloatFunction (https://github.com/apache/lucene/blob/main/lucene/queries/src/java/org/apache/lucene/queries/function/valuesource/MaxFloatFunction.java) both check if values exist twice. This change prevents the duplicate exists check.

      Tested with JMH here: https://github.com/risdenk/lucene-jmh

      Benchmark Mode Cnt Score and Error Units
      ----------------------------------------------------------------- -------
      ------------------ -------
      MyBenchmark.testMaxFloatFunction thrpt 25 64.159 ± 2.031 ops/s
      MyBenchmark.testNewMaxFloatFunction thrpt 25 94.997 ± 2.365 ops/s
      MyBenchmark.testMaxFloatFunctionRareField thrpt 25 244.921 ± 6.439 ops/s
      MyBenchmark.testNewMaxFloatFunctionRareField thrpt 25 239.288 ± 5.136 ops/s

      Attachments

        1. flamegraph.png
          497 kB
          Kevin Risden
        2. flamegraph_getValueForDoc.png
          535 kB
          Kevin Risden

        Issue Links

          Activity

            People

              krisden Kevin Risden
              krisden Kevin Risden
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m