Hi
I am using thrift for passing data among multiple layers. Most of our
data is streaming, it is array of primitives like doubles, ints. Thrift
requires me to use a List in the IDL, which on the Java side translates
to ArrayList of Integers. I find two problems with this approach
1. Integers are heavier than ints are, so it bloats up the memory.
Something like an int[] rather than ArrayList<Integer> would have been
perfect for our kind of usecase.
2. A list of integers is read integer by integer, rather than all of it
in a single shot. This bring down the performance as the 2million
integers mean that many method calls.
Is there a clean way of passing primitive arrays? Thrift provide byte
which is basically byte[], so I guess there should be some way for int[]
or double[] as well.
Regards
Sumanta
- Thrift containers for java Sumanta Bhowmik
-