a2 / MessagePack.swift

It's like JSON, but fast and small…and Swift! – msgpack.org[Swift]
http://msgpack.org
MIT License
283 stars 60 forks source link

Buffer pointer instead of uint8 array generator #30

Closed prcela closed 7 years ago

prcela commented 8 years ago

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