Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Beyond JSON @ dot swift 2016

1,617 views

Published on

Introduction to FlatBuffersSwift

Published in: Engineering
  • Be the first to comment

Beyond JSON @ dot swift 2016

  1. 1. Beyond JSON @iceX33
  2. 2. What was the most discussed topic of Swift community?
  3. 3. JSON parsing!
  4. 4. What if I tell you there is another way?
  5. 5. Meet FlatBuffers It was originally created at Google for game development and other performance-critical applications.
  6. 6. FlatBuffers is an efficient cross platform serialization library for C++, Java, C#, Go, Python and JavaScript (C, PHP & Ruby in progress).
  7. 7. FlatBuffersSwift
  8. 8. What is so good about FlatBuffers?
  9. 9. There is no parsing involved!!! Reading data can be done lazy (almost zero cost)
  10. 10. It's backwards and forwards compatible new code can read old data & old code can read new data
  11. 11. It's not human readable And it's a good thing! (Easy to encrypt and to compress)
  12. 12. { "name": "maxim", "age" : 34 }
  13. 13. 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
  14. 14. FlatBuffers Swift has a really nice API: let person = Person(name: "maxim", age: 34) person.toByteArray
  15. 15. FlatBuffers Swift has a really nice API: let person = Person.LazyAccess(data: fbData) let age = person.age
  16. 16. If you are interested or want to get involved? https://github.com/mzaks/ FlatBuffersSwift
  17. 17. Thank you @iceX33

×