Skip to content
Comparison between FlatBuffer vs JSON
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea
app
gradle/wrapper
.gitignore
LICENSE
README.md
build.gradle
comparison.png
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

##FlatBuffers vs JSON

I ran the demo app which contains a sample JSON file (963 bytes), and tried parsing the file using gson and flatbuffer.

Here is the screenshot of the demo app.

Comparison

###Results

  • Time : Flatbuffer took 3-8 ms, whereas gson took 30-40 ms to parse the file.
  • Memory : Memory footprint was very less in case of FlatBuffers as compared to gson

##FlatBuffer Setup Intro

  • Clone the flatbuffer github repo to your local machine git clone https://github.com/google/flatbuffers.git

  • cd flatbuffers

  • Run the command

    1. cmake -G "Unix Makefiles"
    2. make
  • This will generate the flatc compiler in your root project directory.

  • ./flatc -j -b schema.fbs sample.json to generate the FlatBuff files.

You can’t perform that action at this time.