Fragments 2019

State of mobile engineering, state of platforms, hardware and user research.

Performant and Reflection-Less JSON Parsing using STAG

Submitted by Anirudh Ramanan (@skynet) on Mar 14, 2018

Technical level: Advanced Status: Rejected

Abstract

How to improve the performance of JSON parsing in Android, and why STAG ?

This talk will cover the internal working of the infamous GSON library, and the performance bottlenecks that we hit, and how to take a Reflection-Less approach for the same.

Outline

  • How GSON serializes/deserailizes objects ?
  • Why is Reflection Expensive ?
  • Performance Issues with Current Implementation
  • What is TypeAdapter, and why to use it ?
  • Introduction to STAG
  • STAG in Parity with GSON

Speaker bio

While working on the performance aspects of parsing, we came across a library STAG. The overall idea of the library was good, and with initial testing we found a good boost in parsing performance. We added a bunch of features, and contributed back to the open source community. Now, STAG is in parity with GSON, and we had ~20% improvement in parsing time, and cold boot time.

Mobile Developer @Flipkart

Slides

https://docs.google.com/presentation/d/1vwhYP-sZAWSZjEeXnQaAKDcPPadLBrFQAUonNh0PwM0/edit?usp=sharing

Comments

{{ gettext('Login to leave a comment') }}

{{ gettext('You need to be a participant to comment.') }}

{{ formTitle }}
{{ gettext('Post a comment...') }}
{{ gettext('New comment') }}

{{ errorMsg }}