Use Block#bytesCompare for comparisions with strings#17995
Use Block#bytesCompare for comparisions with strings#17995raunaqmorarka merged 1 commit intotrinodb:masterfrom
Conversation
Avoids overhead of creating a Slice from VariableWidthBlock for LESS_THAN and LESS_THAN_OR_EQUAL comparisions with constant strings Before Benchmark Mode Cnt Score Error Units BenchmarkPageProcessor.compiled thrpt 50 3956.935 ± 96.529 ops/s BenchmarkPageProcessor.handCoded thrpt 50 4515.943 ± 35.327 ops/s After Benchmark Mode Cnt Score Error Units BenchmarkPageProcessor.compiled thrpt 50 6258.105 ± 172.675 ops/s BenchmarkPageProcessor.handCoded thrpt 50 7024.419 ± 116.318 ops/s
| if (operatorConvention.callingConvention().getArgumentConventions().equals(List.of(BLOCK_POSITION, BLOCK_POSITION))) { | ||
| comparisonCallingConvention = simpleConvention(FAIL_ON_NULL, BLOCK_POSITION, BLOCK_POSITION); | ||
| } | ||
| else if (operatorConvention.callingConvention().getArgumentConventions().equals(List.of(NEVER_NULL, BLOCK_POSITION))) { |
There was a problem hiding this comment.
what if type does not implement that convention?
There was a problem hiding this comment.
The code below passes tis convention to adaptOperator, which will look for the exact a function with that exact convention, and if not found it will ask for the (NEVER_NULL, NEVER_NULL ) version and adapt that to (NEVER_NULL, BLOCK_POSITION) using the scalar function adapter
| if (operatorConvention.callingConvention().getArgumentConventions().equals(List.of(BLOCK_POSITION, BLOCK_POSITION))) { | ||
| comparisonCallingConvention = simpleConvention(FAIL_ON_NULL, BLOCK_POSITION, BLOCK_POSITION); | ||
| } | ||
| else if (operatorConvention.callingConvention().getArgumentConventions().equals(List.of(NEVER_NULL, BLOCK_POSITION))) { |
There was a problem hiding this comment.
The code below passes tis convention to adaptOperator, which will look for the exact a function with that exact convention, and if not found it will ask for the (NEVER_NULL, NEVER_NULL ) version and adapt that to (NEVER_NULL, BLOCK_POSITION) using the scalar function adapter
|
No noticeable change in TPC |
Description
Avoids overhead of creating a Slice from VariableWidthBlock for LESS_THAN and LESS_THAN_OR_EQUAL comparisions with constant strings
Additional context and related issues
Release notes
( ) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
( ) Release notes are required, with the following suggested text: