Commit Graph

3 Commits

Author SHA1 Message Date
Helge Heß 8e12a8a910
Keep array context values around
... this may be a no-op optimization,
but well.

It is actually trigger to do the right thing here.
In this version we flush the `values` array, which
transfers ownership of the array buffer to the
RESPValue.
But that buffer is never going to be modified, so
it would be nice to keep it alive. But if we do
keep it alive, we also keep the RESPValues alive,
which may point to full ByteBuffer's, which is
not desirable.

Whatever you do in Swift, you loose ;-)
2018-04-13 15:04:02 +02:00
Helge Heß 9c42e91687
Use array for ParserState
Disadvantage is that we cannot reuse the
Contiguous value array for the top-level
item.
(we could try to cache the struct in an
 ivar w/ a few hops).

Another option would be to use a fixed
size array or even a buffer-bptr to avoid
the range checks.
2018-04-13 14:36:46 +02:00
Helge Heß 0f6b7baa77
Move RESPParser to own file/struct
Instead of being embedded in the RedisChannel,
move the parser out, into an own struct.

This way we may be able to avoid NIO channel
pipeline overhead (NIOAny wrapping).
2018-04-13 13:45:19 +02:00