On Tue, Jun 22, 2010 at 1:28 PM, Evan Jones <[email protected]> wrote:
> On Jun 22, 2010, at 13:54 , sheila miguez wrote:
>>
>> When I have a message to compress, I know the size of the byte array
>> stream buffer to allocate. Then call the writeTo on it. Is there
>> anything I should do other than this, given a message? writeTo should
>> be pretty performant, yes? In unit test, when measuring the speed that
>> takes, it is pretty good.
>
> I don't quite understand what you are doing. Are you allocating a
> ByteArrayOutputStream, writing the message to it, then passing the byte[]
> from the ByteArrayOutputStream to some LZO library? You could just call
> message.toByteArray() if that is what you want, which will be faster.

I've got a servlet filter which wraps the HttpServletResponse. So, the
servlet response's output stream, which is wrapped in a stream from
the lzo library, is compressing data as it is getting written to.

> I haven't tested this carefully, but my experience is that if you want the
> absolute best performance while using the Java API:
>
> [helpful info]

> Does the LZO library have an OutputStream API? This would allow you to

Yes.

For the curious, I'm using code from http://github.com/kevinweil/hadoop-lzo

> Hope this helps,
>
> Evan

Thank you


-- 
sheila

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to