You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by vipin singh <si...@gmail.com> on 2010/09/07 10:15:12 UTC

Changing default java.arraylist to array for List type defined in IDL

Hi All,

I am using lots of List objects in the IDL. Thrift generates ArrayList for
these objects by default, which makes my IPC slow.
As obvious and supported by some experiments done by me, It will be much
faster if an Array could be used instead of the ArrayList.

Does thrift provide any way of changing these default container specific to
a language (java in my case). I came across one such mention in the thrift
documentation "While defaults are provided, the type mappings are not
explicitly fixed. Custom code generator directives have been added to allow
substitution of custom types in various destination languages.". How can I
do it for my case, If i can get any sample tutorial/example, It will be
great.

Thanks
Vipin Singh

Re: Changing default java.arraylist to array for List type defined in IDL

Posted by Bryan Duxbury <br...@rapleaf.com>.
We don't currently have support for this. It's something you'd have to code
up yourself.

What about ArrayLists make your IPC slow? I'd be curious to hear if there
are things we could improve upon.

On Tue, Sep 7, 2010 at 1:15 AM, vipin singh <si...@gmail.com>wrote:

> Hi All,
>
> I am using lots of List objects in the IDL. Thrift generates ArrayList for
> these objects by default, which makes my IPC slow.
> As obvious and supported by some experiments done by me, It will be much
> faster if an Array could be used instead of the ArrayList.
>
> Does thrift provide any way of changing these default container specific to
> a language (java in my case). I came across one such mention in the thrift
> documentation "While defaults are provided, the type mappings are not
> explicitly fixed. Custom code generator directives have been added to allow
> substitution of custom types in various destination languages.". How can I
> do it for my case, If i can get any sample tutorial/example, It will be
> great.
>
> Thanks
> Vipin Singh
>