{"id":15111229,"url":"https://github.com/gmitch215/benchmarks","last_synced_at":"2025-10-30T08:32:11.763Z","repository":{"id":257057117,"uuid":"856664993","full_name":"gmitch215/benchmarks","owner":"gmitch215","description":"📊 Browsable Benchmarks for Programming Languages","archived":false,"fork":false,"pushed_at":"2025-04-10T05:43:06.000Z","size":5313,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T02:24:10.612Z","etag":null,"topics":["benchmark","bun","c","clang","cpp","deno","gcc","gnu","go","golang","java","javascript","kotlin","kotlin-native","nodejs","php","ruby","rust","rustc","zig"],"latest_commit_sha":null,"homepage":"http://benchmarks.gmitch215.dev","language":"Kotlin","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/gmitch215.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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},"funding":{"patreon":"gmitch215","liberapay":"gmitch215","buy_me_a_coffee":"gmitch215"}},"created_at":"2024-09-13T01:19:21.000Z","updated_at":"2025-04-02T16:32:16.000Z","dependencies_parsed_at":"2024-10-25T03:14:42.301Z","dependency_job_id":"db91b8f6-1190-41c4-8d16-3b29a1982402","html_url":"https://github.com/gmitch215/benchmarks","commit_stats":{"total_commits":17,"total_committers":2,"mean_commits":8.5,"dds":"0.11764705882352944","last_synced_commit":"477afa2e0cadf352a86cd700df5628cebe4ad110"},"previous_names":["gmitch215/benchmarks"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmitch215%2Fbenchmarks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmitch215%2Fbenchmarks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmitch215%2Fbenchmarks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmitch215%2Fbenchmarks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gmitch215","download_url":"https://codeload.github.com/gmitch215/benchmarks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248506271,"owners_count":21115408,"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":["benchmark","bun","c","clang","cpp","deno","gcc","gnu","go","golang","java","javascript","kotlin","kotlin-native","nodejs","php","ruby","rust","rustc","zig"],"created_at":"2024-09-26T00:02:37.868Z","updated_at":"2025-10-30T08:32:06.742Z","avatar_url":"https://github.com/gmitch215.png","language":"Kotlin","funding_links":["https://patreon.com/gmitch215","https://liberapay.com/gmitch215","https://buymeacoffee.com/gmitch215"],"categories":[],"sub_categories":[],"readme":"# ⌚ benchmarks\n\n\u003e Programming benchmarks\n\n[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/gmitch215/benchmarks/build.yml)](https://github.com/gmitch215/benchmarks)\n[![GitHub License](https://img.shields.io/github/license/gmitch215/benchmarks)](https://github.com/gmitch215/benchmarks)\n[![GitHub Discussions](https://img.shields.io/github/discussions/gmitch215/benchmarks)](https://github.com/gmitch215/benchmarks/discussions)\n[![GitHub Repo stars](https://img.shields.io/github/stars/gmitch215/benchmarks?style=flat)](https://github.com/gmitch215/benchmarks)\n\nThis repository contains various benchmarks on different programming languages for different algorithms. The primary goal of this repository is to provide a comparison between different programming languages and their speeds.\n\nYou can navigate to the website [here](https://benchmarks.gmitch215.xyz), or by clicking the linked website on the repository.\n\n## Local Benchmarking\n\nThis repository also features the ability to benchmark all the algorithms locally.\n\n### Running Specific Benchmarks\n\nBenchmarks offers two gradle tasks: `compileBenchmark` and `runBenchmark`, to run specific benchmarks.\n\n```bash\n./gradlew compileBenchmark runBenchmark -Planguage={language} -Pfile={file}\n```\n\nFor example, to run `count-1M` for `c` using Clang, you would run:\n\n```bash\n./gradlew compileBenchmark runBenchmark -Planguage=c-llvm -Pfile=count-1M/main.c\n```\n\n\u003e [!NOTE]\n\u003e `compileBenchmark` is only required to be passed for compiled languages. Gradle will automatically skip interpreted languages passed,\n\u003e like `python` and `ruby`.\n\n```bash\n./gradlew runBenchmark -Planguage=ruby -Pfile=count-1M/main.rb\n```\n\n#### `compileBenchmark`\n\nAny language with a `compile` command in the [`config.yml`](./benchmarks/config.yml) file needs to be compiled first before it can run with the `run` commmand.\n\nTo compile the code, you can run the `compileBenchmark` task in the root directory for the repository:\n\n```bash\n./gradlew compileBenchmark -Planguage={language} -Pfile={file}\n```\n\nThe task accepts two parameters:\n\n`language` - ID of the language in the [`config.yml`](./benchmarks/config.yml) file\n\n`file` - File to compile relative to the `benchmarks` directory\n\nFor example, to compile the HTTP GET benchmark for Kotlin/Native, you would run:\n\n```bash\n./gradlew compileBenchmark -Planguage=kotlin-native -Pfile=http-get/main.kt\n```\n\n#### `runBenchmark`\n\nAfter compiling the benchmarks, you can run them using the `runBenchmark` task:\n\n```bash\n./gradlew runBenchmark -Planguage={language} -Pfile={file}\n```\n\n\u003e [!NOTE]\n\u003e `compileBenchmark` is only required to be passed for compiled languages. You can use `runBenchmark` for interpreted languages:\n\n```bash\n./gradlew runBenchmark -Planguage=ruby -Pfile=count-1M/main.rb\n```\n\nThe task accepts the same parameters as the `compileBenchmark` task.\n\nFor example, to run the HTTP GET benchmark for Kotlin/Native, you do:\n\n```bash\n./gradlew compileBenchmark runBenchmark -Planguage=kotlin-native -Pfile=http-get/main.kt\n```\n\n`http-get` measures in `ms` according to its benchmark [`config.yml`](./benchmarks/http-get/config.yml), so the output will be in milliseconds.\n\n### Running All Benchmarks\n\n#### Prerequisites\n\n**All** command line tools present in [`config.yml`](./benchmarks/config.yml) must be installed. You can determine if you meet them by running\nthe `version`, `compile`, and/or `run` commands in the terminal.\n\nHere are some notable examples:\n\n- `python` for Python\n- `java` for Java\n  - Using the JDK for Gradle requires Java 21 or higher.\n  - Using the `java` command on the command line requires Java 8 or higher.\n- `kotlinc` for Kotlin JVM\n  - This requires the `KOTLIN_HOME` environment variable to be set to the Kotlin compiler directory (**not** the bin directory).\n- `kotlinc-native` for Kotlin Native\n  - This requires the `KOTLIN_NATIVE_HOME` environment variable to be set to the Kotlin Native compiler directory (**not** the bin directory).\n- `ruby` for Ruby\n- `native-image` for GraalVM\n  - This requires the `GRAALVM_HOME` environment variable to be set to the GraalVM directory (**not** the bin directory).\n- `gcc`/`g++` **and** `clang`/`clang++` for C/C++\n- `rustc` for Rust\n- `go` for Go\n- `node`, `deno` **and** `bun` for JavaScript\n- `ruby` for Ruby\n- `php` for PHP\n- `zig` for Zig\n\nYou can test if you have the necessary tools and setup by running the `validate` gradle task:\n\n```bash\n./gradlew validate\n```\n\n#### IntelliJ IDEA\n\nThe repository comes with two IntelliJ IDEA run configuration that allows you to run benchmarks directly from the IDE:\n\n- `benchmark` - Runs and graphs the benchmarks\n- `all` - Runs and graphs the benchmarks, then prepares and serves the website\n\n#### CLI\n\nTo both run and graph the benchmarks, you can use the following command:\n\n```bash\n./gradlew benchmark\n```\n\nBenchmarks will be generated in JSON format in the `benchmarks/output` directory.\n\nInteractive HTML graphs are available in the `benchmarks/output/graphs` directory.\n\nAfter that, you can prepare and serve the website by running:\n\n```bash\n./gradlew preview\n```\n\nYou can navigate to the website by visiting `http://localhost:4000`.\n\nThe preview output only creates benchmarks for your hosting operating system. \nFor example, if you're benchmarking your computer on a Windows machine, clicking on `macOS` or `Linux` will report a 404 error.\nOtherwise, you can navigate through the website as if it were live.\n\n![Website Preview](.github/preview.png)\n\n## Contributing\n\nContributors are always welcome.\n\nIf you would like to contribute to this repository, please read the [CONTRIBUTING.md](./CONTRIBUTING.md) file.\n\n## License\n\nThis repository is licensed under the [Apache License 2.0](./LICENSE).\n\nAs per outlined in the license, you are free to use, modify, distribute, and sublicense this repository for personal or commercial use.\nHowever, you must include the **original copyright** and **license** in any copy of the software.\n\nBy using the software, locally or on its [website](https://benchmarks.gmitch215.xyz), you agree to the terms and conditions outlined in the license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmitch215%2Fbenchmarks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgmitch215%2Fbenchmarks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmitch215%2Fbenchmarks/lists"}