{"id":25006678,"url":"https://github.com/javierpe/kotlin-json-deserialization-benchmark","last_synced_at":"2026-04-27T12:02:26.035Z","repository":{"id":175434109,"uuid":"653885745","full_name":"javierpe/Kotlin-JSON-Deserialization-Benchmark","owner":"javierpe","description":"A Kotlin JSON Deserialization Performance Test","archived":false,"fork":false,"pushed_at":"2023-07-08T00:41:40.000Z","size":101,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T00:16:30.624Z","etag":null,"topics":["benchmark","gson","gson-library","jhm","json","kotlin","kotlin-serialization","moshi","performance","performance-analysis","testing"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/javierpe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-15T00:45:40.000Z","updated_at":"2023-06-15T15:10:23.000Z","dependencies_parsed_at":"2023-07-09T06:15:33.142Z","dependency_job_id":null,"html_url":"https://github.com/javierpe/Kotlin-JSON-Deserialization-Benchmark","commit_stats":null,"previous_names":["javierpe/kotlin-json-deserialization-benchmark"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/javierpe/Kotlin-JSON-Deserialization-Benchmark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javierpe%2FKotlin-JSON-Deserialization-Benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javierpe%2FKotlin-JSON-Deserialization-Benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javierpe%2FKotlin-JSON-Deserialization-Benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javierpe%2FKotlin-JSON-Deserialization-Benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/javierpe","download_url":"https://codeload.github.com/javierpe/Kotlin-JSON-Deserialization-Benchmark/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javierpe%2FKotlin-JSON-Deserialization-Benchmark/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32335297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["benchmark","gson","gson-library","jhm","json","kotlin","kotlin-serialization","moshi","performance","performance-analysis","testing"],"created_at":"2025-02-05T01:50:41.755Z","updated_at":"2026-04-27T12:02:26.007Z","avatar_url":"https://github.com/javierpe.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSON Deserialization Benchmark Test\nThe following Benchmark aims to compare the following libraries to deserialize JSON:\n* [Gson](https://github.com/google/gson)\n* [Kotlin Serialization](https://github.com/Kotlin/kotlinx.serialization)\n* [Moshi](https://github.com/square/moshi)\n\n## Requirement\nAn architecture based on SDUI is being developed which has to have an optimal JSON deserialization engine\n\n## Development goals\n* Transform complex data models in such a way that application performance is not affected\n* Easy to implement and understand for new developers\n* Scalable and maintainable\n* Application weight\n\n## Test goals\n* Performance of each library\n* Development complexity\n* Determine the additional weight of each library\n\n## Tools\nIt uses [Kotlin Benchmark](https://github.com/Kotlin/kotlinx-benchmark) wich is based on [Java Microbenchmark Harness (JHM)](https://github.com/openjdk/jmh).\n\n## Metrics\n### Throughput\n**Operations per unit of time**\n\nCounting the total throughput over all worker threads. This mode is time-based, and it will run until the iteration time expires.\n### Average\n**Average time per operation**\n\nCounting 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.\n### Single shot time\n**Measures the time for a single operation**\n\nThis 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.\nCaveats for this mode include:\n* More warmup/measurement iterations are generally required.\n* Timers overhead might be significant if benchmarks are small; switch to SampleTime mode if that is a problem.\n\n## Considerations\nThis test is performed under the following environment:\n* Hardware:\n  * MacBook Pro 13\" M1 2020\n  * 16 GB RAM\n* Software \n  * macOS 13.4 (22F66)\n  * IntelliJ IDEA 2023.1.2 (Community Edition) | Build #IC-231.9011.34\n \n ## Test JSON\n ```json\n\n{\n  \"header\": [\n    {\n      \"render\": \"text\",\n      \"index\": 1,\n      \"resource\": {\n        \"text\": \"This is a header\"\n      }\n    }\n  ],\n  \"body\": [\n    {\n      \"render\": \"text\",\n      \"index\": 1,\n      \"resource\": {\n        \"text\": \"This is a body\"\n      }\n    },\n    {\n      \"render\": \"banner\",\n      \"index\": 2,\n      \"resource\": {\n        \"url\": \"https://i.pinimg.com/474x/d6/9f/8b/d69f8b207b2a999ef6f843cc62ebbc49.jpg\",\n        \"type\": \"with_text\"\n      }\n    },\n    {\n      \"render\": \"message_text\",\n      \"index\": 3,\n      \"resource\": {\n        \"message\": \"This is a message component\"\n      }\n    }\n  ]\n}\n\n```\n\n# Results\n\n## Throughput\n\u003cimg width=\"932\" alt=\"Captura de pantalla 2023-06-27 a la(s) 18 45 19\" src=\"https://github.com/javierpe/Kotlin-JSON-Deserialization-Benchmark/assets/7097754/a02719cb-6a03-44fc-af3d-61b983184ebc\"\u003e\n\n## Average time\n\u003cimg width=\"932\" alt=\"Captura de pantalla 2023-06-27 a la(s) 18 45 39\" src=\"https://github.com/javierpe/Kotlin-JSON-Deserialization-Benchmark/assets/7097754/418722bf-fcfd-461c-b8ad-3860deb5e68c\"\u003e\n\n## Single shot time\n\u003cimg width=\"932\" alt=\"Captura de pantalla 2023-06-27 a la(s) 18 45 55\" src=\"https://github.com/javierpe/Kotlin-JSON-Deserialization-Benchmark/assets/7097754/b2953d68-2b66-4ad2-84fe-b265a0513e3c\"\u003e\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavierpe%2Fkotlin-json-deserialization-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjavierpe%2Fkotlin-json-deserialization-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavierpe%2Fkotlin-json-deserialization-benchmark/lists"}