On Fri, Apr 24, 2015 at 4:03 AM, Nick Wellnhofer <[email protected]> wrote:

> +1. Also see CLOWNFISH-11:
>
>     https://issues.apache.org/jira/browse/CLOWNFISH-11

Heh.

>From the issue:

    I recently toyed with the idea of reworking Clownfish's ByteBuf in a way
    similar to the immutable String changes. This would mean to use a separate
    class for immutable byte buffers replacing ViewByteBuf and restrict
    ByteBuf to creating byte buffers.

    The immutable ByteBuf class could then have a companion iterator class
    that can be used to parse a byte buffer's content. All the
    NumUtils_decode_* functions could go there, for example.

    The NumUtils_encode_* function could be made methods of the mutable
    ByteBuf.

+1 to everything in your first paragraph.

For now, I don't think adding encoders/decoders for primitive types onto
Blob/ByteBuf is pressing, and I suggest we delay that discussion.  But it
would be great to do something with NumberUtils -- the Clownfish runtime only
uses it once internally and it isn't essential functionality that Clownfish
absolutely needs to support.

Lucy uses the NumUtil_ inline routines extensively and in
performance-sensitive locations like BitVector.  It won't be able to use
methods on ByteBuf or Blob or their iterators without taking a speed hit.

For now, I propose that we move the NumberUtils module back to Lucy, where it
will be private.

Marvin Humphrey

Reply via email to