{"id":21718200,"url":"https://github.com/protonull/bunbufferconcatenationbenchmark","last_synced_at":"2026-05-11T02:38:31.690Z","repository":{"id":244345969,"uuid":"814972350","full_name":"Protonull/BunBufferConcatenationBenchmark","owner":"Protonull","description":"Benchmarks different Buffer concatenation strategies in Bun.sh","archived":false,"fork":false,"pushed_at":"2024-06-14T05:23:21.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-25T18:13:22.573Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Protonull.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":"2024-06-14T04:52:38.000Z","updated_at":"2024-06-14T17:08:39.000Z","dependencies_parsed_at":"2024-06-14T06:35:14.714Z","dependency_job_id":"b12f7264-52a1-41d1-b524-6facf2a1df65","html_url":"https://github.com/Protonull/BunBufferConcatenationBenchmark","commit_stats":null,"previous_names":["protonull/bunbufferconcatenationbenchmark"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Protonull%2FBunBufferConcatenationBenchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Protonull%2FBunBufferConcatenationBenchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Protonull%2FBunBufferConcatenationBenchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Protonull%2FBunBufferConcatenationBenchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Protonull","download_url":"https://codeload.github.com/Protonull/BunBufferConcatenationBenchmark/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244685465,"owners_count":20493271,"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-26T01:24:28.998Z","updated_at":"2026-05-11T02:38:31.663Z","avatar_url":"https://github.com/Protonull.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BunBufferConcatenationBenchmark\n\nCreated this benchmark as I wanted to test a hunch. I was operating under the delusion that anything NodeJS is therefor\nslow, that manual concatenation would be faster because that's how you do it in low[er]-level languages. Needless to say\nI was completely wrong.\n\n## How to run\n\nClone this repo and execute `bun benchmark.ts`\n\n## Results\n\n```\ncpu: AMD Ryzen 7 3700X 8-Core Processor\nruntime: bun 1.1.13 (x64-linux)\n\nbenchmark                     time (avg)             (min … max)\n----------------------------------------------------------------\n• buffer-concat\n----------------------------------------------------------------\nBuffer.concat()            1'771 µs/iter   (1'519 µs … 2'664 µs)\nUint8Array.set()           2'563 µs/iter   (2'142 µs … 4'234 µs)\nUint8Array.from()            697 ms/iter       (680 ms … 743 ms)\nnew Blob().arrayBuffer()   3'967 µs/iter   (2'397 µs … 8'472 µs)\n\nsummary for buffer-concat\n  Buffer.concat()\n   1.45x faster than Uint8Array.set()\n   2.24x faster than new Blob().arrayBuffer()\n   393.61x faster than Uint8Array.from()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprotonull%2Fbunbufferconcatenationbenchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprotonull%2Fbunbufferconcatenationbenchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprotonull%2Fbunbufferconcatenationbenchmark/lists"}