[
https://issues.apache.org/jira/browse/LUCENE-10534?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17530797#comment-17530797
]
Chris M. Hostetter commented on LUCENE-10534:
---------------------------------------------
I assume these test changes pass w/o your code changes? (At first glance I
thought one of them was proof of a backcompat case, but I'm pretty sure my
first impression was wrong – that's how good of an edge case they are!)
Maybe in addition to (or instead of) the {{DOESNT_EXIST_CONSTANT_VS}} you
added, you could also include a specific test of the "real world" example we
talked about {{sum(field("fieled_name_that_does_not_exist"),const(42))}} so
someone looking at the test years from now doesn't assuming your
{{DOESNT_EXIST_CONSTANT_VS}} is just a completely contrived / invalid impl and
remove it?
Minor point of confusion/clarification...
{code:java}
- assertHits(new FunctionQuery(vs), new float[] {1f, 1f});
assertAllExist(vs);
+ assertHits(new FunctionQuery(vs), new float[] {1f, 1f});
{code}
...that's just you "re-formatting" the order of the checks to be consistent (so
that exists is always checked before hits) correct? ... I hope swapping those
method calls isn't (somehow) necessary for the test to pass?
> MinFloatFunction / MaxFloatFunction calls exists twice
> ------------------------------------------------------
>
> Key: LUCENE-10534
> URL: https://issues.apache.org/jira/browse/LUCENE-10534
> Project: Lucene - Core
> Issue Type: Improvement
> Reporter: Kevin Risden
> Assignee: Kevin Risden
> Priority: Minor
> Attachments: flamegraph.png, flamegraph_getValueForDoc.png
>
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> 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 |
--
This message was sent by Atlassian Jira
(v8.20.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]