Code Monkey home page Code Monkey logo

kotlin-json-deserialization-benchmark's Introduction

JSON Deserialization Benchmark Test

The following Benchmark aims to compare the following libraries to deserialize JSON:

Requirement

An architecture based on SDUI is being developed which has to have an optimal JSON deserialization engine

Development goals

  • Transform complex data models in such a way that application performance is not affected
  • Easy to implement and understand for new developers
  • Scalable and maintainable
  • Application weight

Test goals

  • Performance of each library
  • Development complexity
  • Determine the additional weight of each library

Tools

It uses Kotlin Benchmark wich is based on Java Microbenchmark Harness (JHM).

Metrics

Throughput

Operations per unit of time

Counting the total throughput over all worker threads. This mode is time-based, and it will run until the iteration time expires.

Average

Average time per operation

Counting the average time to call over all worker threads. This is the inverse of {@link Mode#Throughput}, but with different aggregation policy. This mode is time-based, and it will run until the iteration time expires.

Single shot time

Measures the time for a single operation

This mode is useful to estimate the "cold" performance when you don't want to hide the warmup invocations, or if you want to see the progress from call to call, or you want to record every single sample. This mode is work-based, and will run only for a single invocation of Benchmark method. Caveats for this mode include:

  • More warmup/measurement iterations are generally required.
  • Timers overhead might be significant if benchmarks are small; switch to SampleTime mode if that is a problem.

Considerations

This test is performed under the following environment:

  • Hardware:
    • MacBook Pro 13" M1 2020
    • 16 GB RAM
  • Software
    • macOS 13.4 (22F66)
    • IntelliJ IDEA 2023.1.2 (Community Edition) | Build #IC-231.9011.34

Test JSON

{
 "header": [
   {
     "render": "text",
     "index": 1,
     "resource": {
       "text": "This is a header"
     }
   }
 ],
 "body": [
   {
     "render": "text",
     "index": 1,
     "resource": {
       "text": "This is a body"
     }
   },
   {
     "render": "banner",
     "index": 2,
     "resource": {
       "url": "https://i.pinimg.com/474x/d6/9f/8b/d69f8b207b2a999ef6f843cc62ebbc49.jpg",
       "type": "with_text"
     }
   },
   {
     "render": "message_text",
     "index": 3,
     "resource": {
       "message": "This is a message component"
     }
   }
 ]
}

Results

Throughput

Captura de pantalla 2023-06-27 a la(s) 18 45 19

Average time

Captura de pantalla 2023-06-27 a la(s) 18 45 39

Single shot time

Captura de pantalla 2023-06-27 a la(s) 18 45 55

kotlin-json-deserialization-benchmark's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.