Beyond JSON @ dot swift 2016

Post on 16-Apr-2017

1389 Views

Category:

Engineering

2 Downloads

Preview:

Click to see full reader

Transcript

Beyond JSON@iceX33

What was the most discussed topic of Swift community?

JSON parsing!

What if I tell you there is another way?

Meet FlatBuffersIt was originally created at Google for game development and other performance-critical applications.

FlatBuffersis an efficient cross platform serialization library for C++, Java, C#, Go, Python and JavaScript (C, PHP & Ruby in progress).

FlatBuffersSwift

What is so good about FlatBuffers?

There is no parsing involved!!!Reading data can be done lazy (almost zero cost)

It's backwards and forwards compatiblenew code can read old data

&old code can read new data

It's not human readableAnd it's a good thing! (Easy to encrypt and to compress)

{ "name": "maxim", "age" : 34}

12, 0, 0, 0, 8, 0, 12, 0, 4, 0, 8, 0, 8, 0, 0, 0, 8, 0, 0, 0, 34, 0, 0, 0, 5, 0, 0, 0, 109, 97, 120, 105, 109

FlatBuffers Swift has a really nice API:

let person = Person(name: "maxim", age: 34)person.toByteArray

FlatBuffers Swift has a really nice API:

let person = Person.LazyAccess(data: fbData)let age = person.age

If you are interested or want to get involved?https://github.com/mzaks/FlatBuffersSwift

Thank you@iceX33

top related