a2 / MessagePack.swift

It's like JSON, but fast and small…and Swift! – msgpack.org[Swift]

Home Page:http://msgpack.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Buffer pointer instead of uint8 array generator

prcela opened this issue · comments

First, you have a great packer.
I have only one idea or suggestion.
Did you think about using the UnsafePointer < UInt8 > instead of [Uint8]?
It would be faster for unpacking the strings because you can advance pointer for n places instead of using generator that is always advancing for one next byte.

Check this performance improvements that are used in swift for unpacking bytes packed with similar flatbuffers protocol:
https://medium.com/@icex33/10-thousand-times-faster-swift-737b1accd973#.x9281mi2x