[JBoss JIRA] (IPROTO-130) Inefficient ProtobufUtil.fromWrappedByteArray(ImmutableSerializationContext ctx, byte[] bytes)
by Nistor Adrian (Jira)
[ https://issues.redhat.com/browse/IPROTO-130?page=com.atlassian.jira.plugi... ]
Nistor Adrian closed IPROTO-130.
--------------------------------
Resolution: Done
> Inefficient ProtobufUtil.fromWrappedByteArray(ImmutableSerializationContext ctx, byte[] bytes)
> -----------------------------------------------------------------------------------------------
>
> Key: IPROTO-130
> URL: https://issues.redhat.com/browse/IPROTO-130
> Project: Infinispan ProtoStream
> Issue Type: Bug
> Affects Versions: 4.2.5.Final, 4.3.2.Final
> Reporter: Nistor Adrian
> Assignee: Nistor Adrian
> Priority: Major
> Fix For: 4.2.6.Final, 4.3.3.Final
>
>
> The implementation uses a ByteArrayInputStream that wraps the byte[], and then creates a CodedInputStream around it and this copies the input data to its own buffer. This should have been made more efficiently by building a CodedInputStream directly around the byte[] (which internally uses CodedInputStream.ArrayDecoder and doesn't need a buffer copy).
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 11 months
[JBoss JIRA] (IPROTO-129) ProtobufUtil.fromWrappedByteArray should not create a ByteArrayInputStream
by Nistor Adrian (Jira)
[ https://issues.redhat.com/browse/IPROTO-129?page=com.atlassian.jira.plugi... ]
Nistor Adrian updated IPROTO-129:
---------------------------------
Affects Version/s: 4.2.5.Final
> ProtobufUtil.fromWrappedByteArray should not create a ByteArrayInputStream
> --------------------------------------------------------------------------
>
> Key: IPROTO-129
> URL: https://issues.redhat.com/browse/IPROTO-129
> Project: Infinispan ProtoStream
> Issue Type: Bug
> Affects Versions: 4.2.5.Final, 4.3.2.Final
> Reporter: Dan Berindei
> Assignee: Dan Berindei
> Priority: Major
> Fix For: 4.2.6.Final, 4.3.3.Final
>
>
> {{ProtobufUtil.fromWrappedByteArray}} wraps the {{bytep[]}} in a {{ByteArrayInputStream}} and uses that as an input for {{CodedInputStream}}. But that is inefficient, because {{CodedInputStream.StreamDecoder}} needs to allocate a buffer and copy from the stream into the buffer before processing.
> Instead we can pass the {{byte[]}} directly to {{CodedInputStream}} and use {{CodedInputStream.ArrayDecoder}}, which doesn't need a buffer.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 11 months
[JBoss JIRA] (IPROTO-129) ProtobufUtil.fromWrappedByteArray should not create a ByteArrayInputStream
by Nistor Adrian (Jira)
[ https://issues.redhat.com/browse/IPROTO-129?page=com.atlassian.jira.plugi... ]
Nistor Adrian updated IPROTO-129:
---------------------------------
Fix Version/s: 4.2.6.Final
> ProtobufUtil.fromWrappedByteArray should not create a ByteArrayInputStream
> --------------------------------------------------------------------------
>
> Key: IPROTO-129
> URL: https://issues.redhat.com/browse/IPROTO-129
> Project: Infinispan ProtoStream
> Issue Type: Bug
> Affects Versions: 4.2.5.Final, 4.3.2.Final
> Reporter: Dan Berindei
> Assignee: Dan Berindei
> Priority: Major
> Fix For: 4.2.6.Final, 4.3.3.Final
>
>
> {{ProtobufUtil.fromWrappedByteArray}} wraps the {{bytep[]}} in a {{ByteArrayInputStream}} and uses that as an input for {{CodedInputStream}}. But that is inefficient, because {{CodedInputStream.StreamDecoder}} needs to allocate a buffer and copy from the stream into the buffer before processing.
> Instead we can pass the {{byte[]}} directly to {{CodedInputStream}} and use {{CodedInputStream.ArrayDecoder}}, which doesn't need a buffer.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 11 months
[JBoss JIRA] (IPROTO-129) ProtobufUtil.fromWrappedByteArray should not create a ByteArrayInputStream
by Nistor Adrian (Jira)
[ https://issues.redhat.com/browse/IPROTO-129?page=com.atlassian.jira.plugi... ]
Nistor Adrian updated IPROTO-129:
---------------------------------
Fix Version/s: 4.3.3.Final
> ProtobufUtil.fromWrappedByteArray should not create a ByteArrayInputStream
> --------------------------------------------------------------------------
>
> Key: IPROTO-129
> URL: https://issues.redhat.com/browse/IPROTO-129
> Project: Infinispan ProtoStream
> Issue Type: Bug
> Affects Versions: 4.2.5.Final, 4.3.2.Final
> Reporter: Dan Berindei
> Assignee: Dan Berindei
> Priority: Major
> Fix For: 4.2.6.Final, 4.3.3.Final
>
>
> {{ProtobufUtil.fromWrappedByteArray}} wraps the {{bytep[]}} in a {{ByteArrayInputStream}} and uses that as an input for {{CodedInputStream}}. But that is inefficient, because {{CodedInputStream.StreamDecoder}} needs to allocate a buffer and copy from the stream into the buffer before processing.
> Instead we can pass the {{byte[]}} directly to {{CodedInputStream}} and use {{CodedInputStream.ArrayDecoder}}, which doesn't need a buffer.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 11 months
[JBoss JIRA] (IPROTO-130) Inefficient ProtobufUtil.fromWrappedByteArray(ImmutableSerializationContext ctx, byte[] bytes)
by Nistor Adrian (Jira)
[ https://issues.redhat.com/browse/IPROTO-130?page=com.atlassian.jira.plugi... ]
Nistor Adrian updated IPROTO-130:
---------------------------------
Summary: Inefficient ProtobufUtil.fromWrappedByteArray(ImmutableSerializationContext ctx, byte[] bytes) (was: Inefficent ProtobufUtil.fromWrappedByteArray(ImmutableSerializationContext ctx, byte[] bytes) )
> Inefficient ProtobufUtil.fromWrappedByteArray(ImmutableSerializationContext ctx, byte[] bytes)
> -----------------------------------------------------------------------------------------------
>
> Key: IPROTO-130
> URL: https://issues.redhat.com/browse/IPROTO-130
> Project: Infinispan ProtoStream
> Issue Type: Bug
> Affects Versions: 4.2.5.Final, 4.3.2.Final
> Reporter: Nistor Adrian
> Assignee: Nistor Adrian
> Priority: Major
> Fix For: 4.2.6.Final, 4.3.3.Final
>
>
> The implementation uses a ByteArrayInputStream that wraps the byte[], and then creates a CodedInputStream around it and this copies the input data to its own buffer. This should have been made more efficiently by building a CodedInputStream directly around the byte[] (which internally uses CodedInputStream.ArrayDecoder and doesn't need a buffer copy).
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 11 months
[JBoss JIRA] (IPROTO-130) Inefficent ProtobufUtil.fromWrappedByteArray(ImmutableSerializationContext ctx, byte[] bytes)
by Nistor Adrian (Jira)
Nistor Adrian created IPROTO-130:
------------------------------------
Summary: Inefficent ProtobufUtil.fromWrappedByteArray(ImmutableSerializationContext ctx, byte[] bytes)
Key: IPROTO-130
URL: https://issues.redhat.com/browse/IPROTO-130
Project: Infinispan ProtoStream
Issue Type: Bug
Affects Versions: 4.3.2.Final, 4.2.5.Final
Reporter: Nistor Adrian
The implementation uses a ByteArrayInputStream that wraps the byte[], and then creates a CodedInputStream around it and this copies the input data to its own buffer. This should have been made more efficiently by building a CodedInputStream directly around the byte[] (which internally uses CodedInputStream.ArrayDecoder and doesn't need a buffer copy).
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 11 months
[JBoss JIRA] (IPROTO-130) Inefficent ProtobufUtil.fromWrappedByteArray(ImmutableSerializationContext ctx, byte[] bytes)
by Nistor Adrian (Jira)
[ https://issues.redhat.com/browse/IPROTO-130?page=com.atlassian.jira.plugi... ]
Nistor Adrian reassigned IPROTO-130:
------------------------------------
Assignee: Nistor Adrian
> Inefficent ProtobufUtil.fromWrappedByteArray(ImmutableSerializationContext ctx, byte[] bytes)
> ----------------------------------------------------------------------------------------------
>
> Key: IPROTO-130
> URL: https://issues.redhat.com/browse/IPROTO-130
> Project: Infinispan ProtoStream
> Issue Type: Bug
> Affects Versions: 4.2.5.Final, 4.3.2.Final
> Reporter: Nistor Adrian
> Assignee: Nistor Adrian
> Priority: Major
> Fix For: 4.2.6.Final, 4.3.3.Final
>
>
> The implementation uses a ByteArrayInputStream that wraps the byte[], and then creates a CodedInputStream around it and this copies the input data to its own buffer. This should have been made more efficiently by building a CodedInputStream directly around the byte[] (which internally uses CodedInputStream.ArrayDecoder and doesn't need a buffer copy).
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 11 months
[JBoss JIRA] (IPROTO-130) Inefficent ProtobufUtil.fromWrappedByteArray(ImmutableSerializationContext ctx, byte[] bytes)
by Nistor Adrian (Jira)
[ https://issues.redhat.com/browse/IPROTO-130?page=com.atlassian.jira.plugi... ]
Work on IPROTO-130 started by Nistor Adrian.
--------------------------------------------
> Inefficent ProtobufUtil.fromWrappedByteArray(ImmutableSerializationContext ctx, byte[] bytes)
> ----------------------------------------------------------------------------------------------
>
> Key: IPROTO-130
> URL: https://issues.redhat.com/browse/IPROTO-130
> Project: Infinispan ProtoStream
> Issue Type: Bug
> Affects Versions: 4.2.5.Final, 4.3.2.Final
> Reporter: Nistor Adrian
> Assignee: Nistor Adrian
> Priority: Major
> Fix For: 4.2.6.Final, 4.3.3.Final
>
>
> The implementation uses a ByteArrayInputStream that wraps the byte[], and then creates a CodedInputStream around it and this copies the input data to its own buffer. This should have been made more efficiently by building a CodedInputStream directly around the byte[] (which internally uses CodedInputStream.ArrayDecoder and doesn't need a buffer copy).
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 11 months