[
https://issues.apache.org/jira/browse/IGNITE-29308?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Nikita Amelchev updated IGNITE-29308:
-------------------------------------
Description: The Calcite engine calls
{{GridCacheContext#unwrapBinaryIfNeeded}} for every column value of every row
it reads ({{{}CacheTableDescriptorImpl.FieldDescriptor#value{}}}). A value of a
simple SQL type ({{{}Integer{}}}, {{{}String{}}}, etc.) has nothing to unwrap,
but it still goes through the {{instanceof Map.Entry}} and {{instanceof
CacheObject}} checks, which fail, and on JDK 17 a failed {{instanceof}} against
an interface is a linear scan over the interfaces of the value class
(JDK-8180450). These checks take most of the time of the call for such values.
(was: {{CacheObjectUtils#unwrapBinaryIfNeeded}} is called by the Calcite engine
for every column value of every row it reads. For a plain value
({{{}Integer{}}}, {{{}String{}}}, etc.) the method performs the {{o instanceof
Map.Entry}} and {{o instanceof CacheObject}} checks, both of which fail, and on
JDK 17 a failed {{instanceof}} against an interface is a linear scan over the
interfaces of the value class (JDK-8180450). These two checks take most of the
time of the call for such values, although there is nothing to unwrap in them.)
> Avoid failed interface type checks for plain values in
> CacheObjectUtils#unwrapBinaryIfNeeded
> --------------------------------------------------------------------------------------------
>
> Key: IGNITE-29308
> URL: https://issues.apache.org/jira/browse/IGNITE-29308
> Project: Ignite
> Issue Type: Bug
> Reporter: Nikita Amelchev
> Assignee: Nikita Amelchev
> Priority: Major
> Fix For: 2.20
>
> Time Spent: 50m
> Remaining Estimate: 0h
>
> The Calcite engine calls {{GridCacheContext#unwrapBinaryIfNeeded}} for every
> column value of every row it reads
> ({{{}CacheTableDescriptorImpl.FieldDescriptor#value{}}}). A value of a simple
> SQL type ({{{}Integer{}}}, {{{}String{}}}, etc.) has nothing to unwrap, but
> it still goes through the {{instanceof Map.Entry}} and {{instanceof
> CacheObject}} checks, which fail, and on JDK 17 a failed {{instanceof}}
> against an interface is a linear scan over the interfaces of the value class
> (JDK-8180450). These checks take most of the time of the call for such values.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)