You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Chris Westin (JIRA)" <ji...@apache.org> on 2014/12/12 20:58:13 UTC

[jira] [Updated] (DRILL-1854) reduce number of local variables in generated operators by reusing them

     [ https://issues.apache.org/jira/browse/DRILL-1854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Westin updated DRILL-1854:
--------------------------------
    Issue Type: Improvement  (was: Bug)

> reduce number of local variables in generated operators by reusing them
> -----------------------------------------------------------------------
>
>                 Key: DRILL-1854
>                 URL: https://issues.apache.org/jira/browse/DRILL-1854
>             Project: Apache Drill
>          Issue Type: Improvement
>          Components: Execution - Codegen
>            Reporter: Chris Westin
>            Assignee: Chris Westin
>
> Every time code gen inlines a function, it generates new temporaries for it to use. The number of locals is getting very large for some functions -- I've seen one case with about 300. But all of these locals are only referenced within a single block. It appears that the java compiler (at least Janino) does not reuse these (compare with a C/C++ compiler, which would reuse the same stack space across blocks). We can be smarter about not generating new temporaries, and just reusing compatible ones if they are already available by maintaining a pool (map of Type to variable name) of available variables, and borrowing from these during code generation as necessary.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)