[ 
https://issues.apache.org/jira/browse/IGNITE-4645?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15863560#comment-15863560
 ] 

Vladimir Ozerov edited comment on IGNITE-4645 at 2/13/17 12:18 PM:
-------------------------------------------------------------------

[~gvvinblade], my comments:
1) {{GridBinaryMarshaller}} - we perform new class descriptor lookup. Let's 
make sure that it is re-used inside writer, so that we do not need to perform 
it twice.
2) {{BinaryWriterSchemaHolder}} - constants should be moved to {{BinaryUtils}}. 
They must have meaningful names, as currently it is impossible to understand 
what they are about. 
3) Moreover, {{FOOTER_PER_FIELD_SIZE_4 == FOOTER_PER_FIELD_SIZE_1 + 4}}, where 
{{4}} is additional overhead caused be disabled compact footers. The same goes 
for {{FOOTER_PER_FIELD_SIZE_5}} and {{FOOTER_PER_FIELD_SIZE_6}}. Please remove 
these three constants and introduce separate constant for compact footer.
4) {{BinaryUtils}} - same as p.3, several values are mixed into one for 
{{P_X_BYTE_SIZE}} constants. How {{P_8_BYTE_SIZE}} can be equal to {{9}}? 
Instead, it should be {{8}}, and {{1}} should be moved to separate constant.
5) {{BinaryClassDescriptor}} - please avoid wildcards in imports.
6) {{BinaryClassDescriptor}} - another magic constant {{-1}}.


was (Author: vozerov):
[~gvvinblade], my comments:
1) {{GridBinaryMarshaller}} - we perform new class descriptor lookup. Let's 
make sure that it is re-used inside writer, so that we do not need to perform 
it twice.
2) {{BinaryWriterSchemaHolder}} - constants should be moved to {{BinaryUtils}}. 
They must have meaningful names, as currently it is impossible to understand 
what they are about. 
3) Moreover, {{FOOTER_PER_FIELD_SIZE_4 == FOOTER_PER_FIELD_SIZE_1 + 4]}, where 
{{4}} is additional overhead caused be disabled compact footers. The same goes 
for {{FOOTER_PER_FIELD_SIZE_5}} and {{FOOTER_PER_FIELD_SIZE_6}}. Please remove 
these three constants and introduce separate constant for compact footer.
4) {{BinaryUtils}} - same as p.3, several values are mixed into one for 
{{P_X_BYTE_SIZE}} constants. How {{P_8_BYTE_SIZE}} can be equal to {{9}}? 
Instead, it should be {{8}}, and {{1}} should be moved to separate constant.
5) {{BinaryClassDescriptor}} - please avoid wildcards in imports.
6) {{BinaryClassDescriptor}} - another magic constant {{-1}}.

> Best effort to avoid extra copying in binary marshaller
> -------------------------------------------------------
>
>                 Key: IGNITE-4645
>                 URL: https://issues.apache.org/jira/browse/IGNITE-4645
>             Project: Ignite
>          Issue Type: Bug
>          Components: binary
>            Reporter: Yakov Zhdanov
>            Assignee: Igor Seliverstov
>             Fix For: 1.9
>
>
> If we marshal a class that contain only primitives then we can predict the 
> final byte array size and avoid copies to grow array and final trimming.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to