[
https://issues.apache.org/jira/browse/THRIFT-1854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14268130#comment-14268130
]
Vitali Lovich edited comment on THRIFT-1854 at 1/7/15 8:06 PM:
---------------------------------------------------------------
Do you have any thoughts on the design? There's several ways I can see this
being done:
1: Modify the lexer & parser to support custom type generation. Add templating
support & have each language generator define what the injection points are &
what variables are available for substitution.
2: Embed lua into the compiler & let it load lua files for custom types that
define how to generate that code.
3: Define a plugin interface for custom types & let the compiler load that.
4. Define an executable plugin interface for custom types. The compiler
executes some program to generate the code.
#3 seems like the simplest approach with minimal external dependencies,
although writing those plugins would require C++ and ABI stability would be a
pain. #4 would let you write python scripts to generate these types at the
cost of an uglier mechanism.
was (Author: vlovich):
Do you have any thoughts on the design? There's three ways I can see this
being done:
1: Modify the lexer & parser to support custom type generation. Add templating
support & have each language generator define what the injection points are &
what variables are available for substitution.
2: Embed lua into the compiler & let it load lua files for custom types that
define how to generate that code.
3: Define a plugin interface for custom types & let the compiler load that.
4. Define an executable plugin interface for custom types. The compiler
executes some program to generate the code.
#3 seems like the simplest approach with minimal external dependencies,
although writing those plugins would require C++ and ABI stability would be a
pain. #4 would let you write python scripts to generate these types at the
cost of an uglier mechanism.
> trove support for lists of primitives
> -------------------------------------
>
> Key: THRIFT-1854
> URL: https://issues.apache.org/jira/browse/THRIFT-1854
> Project: Thrift
> Issue Type: New Feature
> Components: Java - Compiler
> Reporter: Vitali Lovich
> Attachments:
> 0001-Add-support-for-trove-option-to-Java-generator.patch,
> 0002-adding-support-to-use-Trove-lists-instead-of-native-.patch,
> 0003-Implement-trove-support-for-sets.patch,
> 0004-Implement-trove-support-for-maps.patch
>
>
> When dealing with large collections of primitive types, there can be
> significant memory (i.e. using arrays of objects instead of arrays of
> primitives) & runtime overhead (autoboxing/unboxing) using the default
> collections. Utilizing trove can significantly improve things. ideally
> support would be added for sets & maps, but as a first pass lists would be
> great.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)