Commit Graph

18 Commits

Author SHA1 Message Date
Helge Heß 59355c9d9c Swift 5: ContiguousCollection => Collection
Not quite sure whether this produces a performance
regression.
2019-03-27 14:23:33 +01:00
Helge Heß 681548ab70 Swift 5 / NIO 2: self.add(name:handler:) -> addHandler
Also the first/last enum.
2019-03-27 14:22:46 +01:00
Helge Heß 3005e79cb3 Swift 5 / NIO 2: write(xyz:) -> writeXYZ()
Same for write(integer:). Use fileprivate shim w/
NIO 2 API.
2019-03-27 14:22:25 +01:00
Helge Heß 20dc5d534b Swift 5: public public
Fix warnings when compiling w/ Swift 5 compiler in 4.x
mode.
2019-03-26 18:59:51 +01:00
Helge Heß de26ed6b35
Make RESPError CustomStringConvertible
... so that we get something useful when printing the error.
2018-05-31 17:19:38 +02:00
Helge Heß 542cfc17b4
Move byte buffer stuff to own file
Maybe I should submit that to NIO itself.
2018-04-16 17:19:53 +02:00
Helge Heß db37a8da9c
Rename RedisChannelHandler to RESPChannelHandler
Fix name.
2018-04-14 11:16:20 +02:00
Helge Heß aaf1b706c4
OMG - indent wrong!!!
No lint no fun.
2018-04-13 18:24:07 +02:00
Helge Heß dae92a76ac
Perf: Use more BB(integerAsString:)
... faster.
2018-04-13 18:15:57 +02:00
Helge Heß 9fe1bce783
itoa 2018-04-13 18:11:11 +02:00
Helge Heß 9011f2097c
Reduce size of RESPValue from 49 to 25
By backing RESPError fields in a class.
This way it isn't taking up storage in
each and every RESPValue.

25 is still > 24 though :-)

(thanks to @weissi for the suggestion)
2018-04-13 16:50:21 +02:00
Helge Heß 5b78b9db82
And a public init
... empty, just to make init public ...
2018-04-13 15:39:56 +02:00
Helge Heß 4631728dab
Open up more functions
... that we wanna override.
2018-04-13 15:35:31 +02:00
Helge Heß 4672c49331
Make RESPChannelHandler work as a base-class
... so that we subclass it.

Intention: workaround NIOAny wrapping overhead.
2018-04-13 15:32:04 +02:00
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
Helge Hess 5fef65eb2f
Initial drop 2018-04-11 00:27:29 +02:00