[ 
https://issues.apache.org/jira/browse/CALCITE-2703?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16779291#comment-16779291
 ] 

Stamatis Zampetakis commented on CALCITE-2703:
----------------------------------------------

Below, I outline a few alternative names (along with a short description) for 
property "calcite.bindable.cache.maxSize". Among them, I still prefer the 
initial one but if you (mostly referring to [~vladimirsitnikov]) have a 
different opinion let me know and I will use that one.

+Reminder+

The interface defines Bindable as a "Statement that can be bound to a 
DataContext and then executed".

+Alternatives+
 * *calcite.bindable.cache.maxSize*: The maximum size of the cache used for 
storing Bindable objects, instantiated via dynamically generated Java classes.
 * *calcite.codegen.plan.cache.maxSize*: The maximum size of the cache used for 
storing execution plans, instantiated via dynamically generated Java classes. 
 * *calcite.executable.cache.maxSize*, *calcite.runtime.plan.cache.maxSize*, 
*calcite.execution.plan.cache.maxSize*: The maximum size of the cache used for 
storing ready to execute query plan instances.
 * *calcite.statement.cache.maxSize*: The maximum size of the cache that is 
used for storing ready to execute statements. 
 * *calcite.interpreter.plan.cache.maxSize*
 * *calcite.interpreter.query.cache.maxSize*

FYI: I plan to merge the PR tomorrow.

> Reduce code generation and class loading overhead when executing queries in 
> the EnumerableConvention
> ----------------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-2703
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2703
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.17.0
>            Reporter: Stamatis Zampetakis
>            Assignee: Stamatis Zampetakis
>            Priority: Major
>              Labels: performance, pull-request-available
>          Time Spent: 3h
>  Remaining Estimate: 0h
>
> The queries using Calcite's EnumerableConvention always end-up generating new 
> java classes at runtime (using Janino) that are then instantiated using 
> reflection. This combination of class generation and class loading introduces 
> a big overhead in query response time.
> A quick profiling on our Company's internal test suite consisting in 4000 
> tests with roughly 430000 SQL queries passing through Calcite we observed 
> that a big amount of time is spend on code generation and class loading 
> making the EnumerableInterpretable#toBindable method a performance 
> bottleneck. 
> Among the 430000 SQL queries there are many duplicates which are going to 
> lead to the generation of exactly the same code Java. Introducing, a small 
> cache at the level of EnumerableInterpretable class could avoid generating 
> and loading the same code over and over again.
> A simple implementation based on Guava improved the overall execution time of 
> the afforementioned test suite by more than 50%.
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to