ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vyacheslav Daradur (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IGNITE-5097) BinaryMarshaller should write ints in "varint" encoding where it makes sense
Date Mon, 05 Jun 2017 09:29:04 GMT

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

Vyacheslav Daradur commented on IGNITE-5097:

bq. Not sure though about int<->uint casts. 
It is equivalent of {{>>>}} unsigned right bit-shift operator in Java
This is necessary in the case of negative numbers, otherwise it may provide infinite loop.
Covered by added unit test.
bq. 1) Does this work for negative values?
Yes it works for negative values, but we shouldn't use it for, because negative values always
take 5 bytes.
bq. 2) Since we use this thing purely for positive values, should we use uint in method signature?
Not sure. I'd prefer not to use {{uint}} for compliance with the Java implementation.

> BinaryMarshaller should write ints in "varint" encoding where it makes sense
> ----------------------------------------------------------------------------
>                 Key: IGNITE-5097
>                 URL: https://issues.apache.org/jira/browse/IGNITE-5097
>             Project: Ignite
>          Issue Type: Task
>          Components: general
>    Affects Versions: 2.0
>            Reporter: Vladimir Ozerov
>            Assignee: Vyacheslav Daradur
>              Labels: important, performance
>             Fix For: 2.1
> There are a lot of places in the code where we write integers for some special purposes.
Quite often their value will be vary small, so that applying "varint" format could save a
lot of space at the cost of very low additional CPU overhead. 
> Specifically:
> 1) Array/collection/map lengths
> 2) BigDecimal's (usually will save ~6 bytes)
> 3) Strings
> 4) Enum ordinals

This message was sent by Atlassian JIRA

View raw message