Skip to content

Commit

Permalink
Remove BIGINT type redirection from PrecomputedHashGenerator
Browse files Browse the repository at this point in the history
BIGINT.getLong is called with multiple Block types
i.e. not only LongArrayBlock but also DictionaryBlock, RunLengthEncodedBlock.
This sometime confuses JIT to do virtual call in the
PrecomputedHashGenerator even if the PrecomputedHashGenerator is
only called with LongArrayBlock and the call to PrecomputedHashGenerator is inlined.
  • Loading branch information
lukasz-stec authored and sopel39 committed May 26, 2022
1 parent d8e99b0 commit b71b5f0
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
package io.trino.operator;

import io.trino.spi.Page;
import io.trino.spi.type.BigintType;
import io.trino.spi.block.Block;

import static com.google.common.base.MoreObjects.toStringHelper;

Expand All @@ -31,7 +31,8 @@ public PrecomputedHashGenerator(int hashChannel)
@Override
public long hashPosition(int position, Page page)
{
return BigintType.BIGINT.getLong(page.getBlock(hashChannel), position);
Block hashBlock = page.getBlock(hashChannel);
return hashBlock.getLong(position, 0);
}

@Override
Expand Down

0 comments on commit b71b5f0

Please sign in to comment.