{"id":19974014,"url":"https://github.com/objectbox/flatbuffers-benchmark","last_synced_at":"2025-07-08T08:36:02.282Z","repository":{"id":45473517,"uuid":"342555758","full_name":"objectbox/flatbuffers-benchmark","owner":"objectbox","description":"Testing the FlatBuffers performance of different programming languages","archived":false,"fork":false,"pushed_at":"2021-12-12T12:34:39.000Z","size":30,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-01T18:33:33.623Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/objectbox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-26T11:31:21.000Z","updated_at":"2024-01-29T07:13:24.000Z","dependencies_parsed_at":"2022-07-14T21:30:40.836Z","dependency_job_id":null,"html_url":"https://github.com/objectbox/flatbuffers-benchmark","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/objectbox/flatbuffers-benchmark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/objectbox%2Fflatbuffers-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/objectbox%2Fflatbuffers-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/objectbox%2Fflatbuffers-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/objectbox%2Fflatbuffers-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/objectbox","download_url":"https://codeload.github.com/objectbox/flatbuffers-benchmark/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/objectbox%2Fflatbuffers-benchmark/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264232436,"owners_count":23576840,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-13T03:13:36.348Z","updated_at":"2025-07-08T08:36:02.262Z","avatar_url":"https://github.com/objectbox.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FlatBuffers performance comparison\n\nThis repository comes with benchmarking code for different FlatBuffer implementations across programing languages.\n\n## Setup\n\n* Benchmarks are CPU bound (no disk operations).\n* Executed on a laptop CPU: Intel Core i7-8850H\n* Dart uses JIT unless AOT is indicated.\n* Dart benchmark_harness executes a 10-call timing loop repeatedly until 2 seconds have elapsed.\n  The reported result is the average of the runtimes.\n* Measured performance is in \"operations per second\": (10 * 1e6 / timeUs)\n\n## Results (more is better)\n\n|     Date   | Variant                         |       Read |      Write |  Read (w.bytes) | Write (w.bytes) |\n|:----------:|---------------------------------|-----------:|-----------:|----------------:|----------------:|\n| 2021-12-12 | Dart official FB v2.0.5         | 11 636 660 |  7 907 070 |       9 185 325 |       6 176 130 |\n| 2021-07-06 | Dart official FB master         |  8 470 985 |  4 063 437 |       4 029 197 |       3 036 950 |\n| 2021-07-06 | Dart ObjectBox v1.1 FB          | 11 296 765 |  8 904 645 |       5 989 820 |       6 517 266 |\n| 2021-02-26 | Dart official FB v0.12          |  8 197 200 |     13 060 |       3 831 742 |          12 178 |\n| 2021-02-26 | Dart official FB master         |  8 878 415 |  3 284 045 |       4 032 722 |       2 592 991 |\n| 2021-02-26 | Dart ObjectBox v0.12 FB         |  9 074 660 |  5 044 802 |       4 732 340 |       4 212 460 |\n| 2021-02-26 | Dart AOT ObjectBox v0.12 FB     |  8 149 270 |  3 821 181 |       5 020 220 |       3 189 186 |\n| 2021-02-26 | Go                              |  9 920 634 |  7 806 401 |       8 438 818 |       7 032 348 |\n\nNote about results with a byte list: when reading a list from FlatBuffers in Dart, we call toList() to complete detach\nfrom the buffer (do not reference data inside the buffer). To be fair/have the numbers for comparison, we do the same in\nGo, though it doesn't have such a big impact there.\n\n### Benchmarked on 2021-12-12\n\n* Dart SDK v2.13.4\n* Dart flat_buffers v2.0.5\n\n```shell\n$ dart run ./benchmark/flatbuffers_official.dart\nMeasuring performance without byte list\nBuilder(RunTime): 1.264690966438896 us.\nReader(RunTime): 0.8593531133503943 us.\nMeasuring performance with byte list\nBuilder(RunTime): 1.6191369028825495 us.\nReader(RunTime): 1.0886931055787357 us.\n```\n\n### Benchmarked on 2021-07-06\n\n* Dart SDK v2.13.4\n* Dart objectbox/flatbuffers fork - from objectbox-dart v1.1.0\n* Dart flat_buffers master (as of 2012-07-06)\n* Null safety enabled (no noticable performance improvement for this change alone)\n\nNotes:\n\n* read speed up by about 10 % was done by improving the benchmark to use `const` constructors of FB readers.\n* both upstream master and ObjectBox FlatBuffers are now null-safe.\n\n```shell\n$ dart run ./benchmark/flatbuffers_official.dart\nMeasuring performance without byte list\nBuilder(RunTime): 2.4609702616502274 us.\nReader(RunTime): 1.1805002605954324 us.\nMeasuring performance with byte list\nBuilder(RunTime): 3.2927768109833697 us.\nReader(RunTime): 2.481883500446739 us.\n\n$ dart run ./benchmark/flatbuffers_objectbox.dart\nMeasuring performance without byte list\nBuilder(RunTime): 1.123009326587794 us.\nReader(RunTime): 0.8852091727144895 us.\nMeasuring performance with byte list\nBuilder(RunTime): 1.5343855632803305 us.\nReader(RunTime): 1.6694992503948365 us.\n```\n\n### Benchmarked on 2021-02-26 and before\n\n* Dart SDK v2.10.5 (FlatBuffers)\n* Dart SDK v2.12.0 (ObjectBox FlatBuffers)\n* Dart flat_buffers v1.12.0\n* Dart flat_buffers master (as of 2012-02-26) with some performance-related PRs we've got merged upstream\n* Dart objectbox/flatbuffers fork - from objectbox-dart v0.12.0\n* Go version go1.15.8\n* Go flatbuffers v1.12.0\n\n#### Dart JIT\n\n```shell\n# v0.12\n$ pub run benchmark/flatbuffers_official.dart\nMeasuring performance without byte list\nBuilder(RunTime): 765.6720244929201 us.\nReader(RunTime): 1.2199287561606402 us.\nMeasuring performance with byte list\nBuilder(RunTime): 821.0898645876077 us.\nReader(RunTime): 2.6097788216872186 us.\n\n# master\n$ pub run benchmark/flatbuffers_official.dart\nMeasuring performance without byte list\nBuilder(RunTime): 3.0450252660971455 us.\nReader(RunTime): 1.1263271653780544 us.\nMeasuring performance with byte list\nBuilder(RunTime): 3.856550051195625 us.\nReader(RunTime): 2.4797140891084815 us.\n\n$ pub run benchmark/flatbuffers_objectbox.dart\nMeasuring performance without byte list\nBuilder(RunTime): 1.9822381638140623 us.\nReader(RunTime): 1.1019696605713052 us.\nMeasuring performance with byte list\nBuilder(RunTime): 2.3739097819326473 us.\nReader(RunTime): 2.113119513813462 us.\n```\n\n#### Dart AOT\n\nWe measured only the fastest variant (ObjectBox fork):\n\n```shell\n$ dart2native benchmark/flatbuffers_objectbox.dart --output bench \u0026\u0026 ./bench\nGenerated: /flatbuffers_benchmark/flatbuffers_dart_benchmark/bench\nMeasuring performance without byte list\nBuilder(RunTime): 2.616991849387036 us.\nReader(RunTime): 1.227103777393558 us.\nMeasuring performance with byte list\nBuilder(RunTime): 3.1355955587468918 us.\nReader(RunTime): 1.9919445761341137 us.\n```\n\n#### Go plain results\n\nTo get (closer) to what Dart does: execute 10 iterations of the same operation for each measured loop.\n\n```shell\n$ go test -bench .\ngoos: linux\ngoarch: amd64\npkg: flatbuffers_go_benchmark\nBenchmarkBuilderWithoutBytesList-12       928960              1281 ns/op\nBenchmarkReaderWithoutBytesList-12       1226929              1008 ns/op\nBenchmarkBuilderWithBytesList-12          819072              1422 ns/op\nBenchmarkReaderWithBytesList-12          1000000              1185 ns/op\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobjectbox%2Fflatbuffers-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobjectbox%2Fflatbuffers-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobjectbox%2Fflatbuffers-benchmark/lists"}