thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kris West <k...@urfilez.com>
Subject Re: thrift to Java mapping question: "list<byte>" mapping to "List<Byte>"
Date Fri, 29 Jul 2011 10:02:07 GMT
...and its not super inefficient. Auto-boxing in the JVM is fairly
efficient.

K

On 29 July 2011 07:55, Chiku <hakisenin@gmail.com> wrote:

> Java does not support List<int>!
> It only supports list of objects. Hence, Integer.
>
> On Fri, Jul 29, 2011 at 8:28 AM, Gautam Thaker <gthaker@verizon.net>
> wrote:
>
> > I have a thrift file that has:
> >
> > typedef list<byte> OctetSeq
> > typedef list<i32> IntegerSeq
> >
> > service ATL {
> >        i16 octet_thruput(1:OctetSeq payload),
> >        i16 integer_thruput(1:IntegerSeq payload)
> > }
> >
> > The code produced by "-gen java" uses the following:
> >
> >
> > OctetSeq -> List<Byte>
> > IntegerSeq -> List<Integer>
> >
> > This produces super inefficient code in Java. Is it possible for the
> > mapping produced to use List<byte>  and List<int> ? I suspect their
> > marshalling and transport and unmarshalling would be far more efficient.
> >
> > As comparison in CPP the mapping produced is:
> >
> > typedef std::vector<int8_t>  OctetSeq;
> > typedef std::vector<int32_t>  IntegerSeq;
> >
> > respectively, and CPP is pretty effecient.
> >
> > Gautam
> >
>



-- 
-
Regards,

Dr Kris West
www.urfilez.com

Tel (US): +1 217 883 4553
Tel (UK): +44 7715 104291 / +44 7715 104292

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message