{"id":31078775,"url":"https://github.com/vltpkg/benchmarks-semver","last_synced_at":"2025-09-16T09:28:12.392Z","repository":{"id":312109581,"uuid":"1041593737","full_name":"vltpkg/benchmarks-semver","owner":"vltpkg","description":"Benchmarking against `node-semver`","archived":false,"fork":false,"pushed_at":"2025-08-20T19:01:12.000Z","size":636,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-28T22:09:12.209Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/vltpkg.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,"zenodo":null}},"created_at":"2025-08-20T18:06:01.000Z","updated_at":"2025-08-21T14:53:43.000Z","dependencies_parsed_at":"2025-08-28T22:09:17.356Z","dependency_job_id":"72ccadb1-61e3-4446-a455-c711599a83f5","html_url":"https://github.com/vltpkg/benchmarks-semver","commit_stats":null,"previous_names":["vltpkg/benchmarks-semver"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/vltpkg/benchmarks-semver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vltpkg%2Fbenchmarks-semver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vltpkg%2Fbenchmarks-semver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vltpkg%2Fbenchmarks-semver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vltpkg%2Fbenchmarks-semver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vltpkg","download_url":"https://codeload.github.com/vltpkg/benchmarks-semver/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vltpkg%2Fbenchmarks-semver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275393931,"owners_count":25456766,"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","status":"online","status_checked_at":"2025-09-16T02:00:10.229Z","response_time":65,"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":[],"created_at":"2025-09-16T09:28:06.939Z","updated_at":"2025-09-16T09:28:12.384Z","avatar_url":"https://github.com/vltpkg.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Semver Benchmarks\n\nA comprehensive benchmark suite comparing semantic version libraries in Node.js, specifically:\n\n- **`node-semver`** - The standard semver parser used by npm\n- **`@vltpkg/semver`** - High-performance semver library by the vlt team\n\n## Features\n\nThis benchmark suite tests the most common semver operations:\n\n- **Parsing** - Converting version strings to version objects\n- **Comparison** - Comparing two versions (compare, gt, lt, eq)\n- **Satisfies** - Checking if a version satisfies a range\n\n## Requirements\n\n- Node.js 22+ (required by @vltpkg/semver)\n- [vlt](https://vlt.sh) package manager\n- [hyperfine](https://github.com/sharkdp/hyperfine) (optional, for detailed benchmarking)\n\n## Installation\n\n```bash\n# Install dependencies using vlt\nvlt install\n\n# Or use the package script\nvlr install-deps\n```\n\n## Usage\n\n### Run Tests\nFirst, verify that both libraries produce consistent results:\n\n```bash\nvlr test\n```\n\n### Run Basic Benchmarks\n```bash\n# Run the comprehensive benchmark suite\nvlr benchmark\n\n# Run individual benchmark categories\nvlr benchmark:parsing\nvlr benchmark:comparison\nvlr benchmark:satisfies\n```\n\n### Run Benchmarks with Chart Generation\nThe new chart generation feature automatically creates performance tables and charts:\n\n```bash\n# Run benchmarks and generate charts/tables in README\nvlr benchmark:generate\n\n# Just collect benchmark data (saves to benchmark-results.json)\nvlr benchmark:collect\n\n# Generate charts from existing results\nvlr benchmark:charts\n```\n\n### Run Hyperfine Benchmarks\nFor more detailed performance analysis with statistical data:\n\n```bash\n# Quick hyperfine benchmark\nvlr benchmark:quick\n\n# Full hyperfine benchmark suite (exports JSON and Markdown results)\nvlr benchmark:hyperfine\n\n# Run all benchmarks (tests + charts + hyperfine)\nvlr benchmark:all\n```\n\n## Results\n\nThe hyperfine benchmarks will generate result files:\n- `results-parsing.json/md` - Parsing operation results\n- `results-comparison.json/md` - Comparison operation results\n- `results-satisfies.json/md` - Satisfies operation results\n- `results-combined.json/md` - Full benchmark suite results\n\n## Expected Performance\n\nBased on the vlt team's documentation, `@vltpkg/semver` should show:\n- **40-50% faster** at parsing versions\n- **15-20% faster** at parsing ranges  \n- **60-70% faster** at testing versions against ranges\n\n\u003c!-- BENCHMARK_RESULTS_START --\u003e\n\n## 🏆 Summary\n\n**@vltpkg/semver** wins overall, taking 2/3 categories.\n\n### Performance Highlights:\n\n- **Parsing**: node-semver is 60% faster\n- **Comparison**: @vltpkg/semver is 84% faster\n- **Satisfies**: @vltpkg/semver is 10% faster\n\n## 📊 Performance Results\n\n| Operation | node-semver | @vltpkg/semver | Winner | Improvement |\n|-----------|-------------|----------------|--------|-------------|\n| Parsing | 131,968 ops/sec | 82,468 ops/sec | 🏆 node-semver | 60% |\n| Comparison | 122,921 ops/sec | 225,656 ops/sec | 🏆 @vltpkg/semver | 84% |\n| Satisfies | 17,860 ops/sec | 19,685 ops/sec | 🏆 @vltpkg/semver | 10% |\n\n## 📈 Performance Comparison Chart\n\n```\nparsing      │\nnode-semver  │████████████████████████████████████████ 131,968\n@vltpkg      │█████████████████████████ 82,468\n             │\ncomparison   │\nnode-semver  │██████████████████████ 122,921\n@vltpkg      │████████████████████████████████████████ 225,656\n             │\nsatisfies    │\nnode-semver  │████████████████████████████████████ 17,860\n@vltpkg      │████████████████████████████████████████ 19,685\n             │\n```\n\n\n## 🔬 Detailed Results\n\n### Parsing Benchmark\n\n| Metric | node-semver | @vltpkg/semver |\n|--------|-------------|----------------|\n| Operations/sec | 131,968 | 82,468 |\n| Mean time (ms) | 0.008 | 0.012 |\n| Margin of error | ±0ms | ±0ms |\n| Relative margin | ±0.97% | ±0.41% |\n| Sample runs | 85 | 96 |\n\n### Comparison Benchmark\n\n| Metric | node-semver | @vltpkg/semver |\n|--------|-------------|----------------|\n| Operations/sec | 122,921 | 225,656 |\n| Mean time (ms) | 0.008 | 0.004 |\n| Margin of error | ±0ms | ±0ms |\n| Relative margin | ±0.11% | ±0.13% |\n| Sample runs | 98 | 97 |\n\n### Satisfies Benchmark\n\n| Metric | node-semver | @vltpkg/semver |\n|--------|-------------|----------------|\n| Operations/sec | 17,860 | 19,685 |\n| Mean time (ms) | 0.056 | 0.051 |\n| Margin of error | ±0ms | ±0.001ms |\n| Relative margin | ±0.23% | ±1.37% |\n| Sample runs | 101 | 95 |\n\n## 🖥️ System Information\n\n- **Node.js**: v24.1.0\n- **Platform**: darwin (arm64)\n- **node-semver**: v7.7.2\n- **@vltpkg/semver**: v0.0.0-22\n- **Test Date**: 2025-08-20, 2:10:09 p.m.\n\n\n\u003c!-- BENCHMARK_RESULTS_END --\u003e\n\n## Test Data\n\nThe benchmarks use a comprehensive set of test cases including:\n\n**Versions:**\n- Standard versions (1.0.0, 2.1.3)\n- Prerelease versions (1.0.0-alpha.1, 1.2.3-beta.4)\n- Build metadata (1.2.3+build.5)\n- Complex prerelease strings\n- Edge cases\n\n**Ranges:**\n- Caret ranges (^1.0.0)\n- Tilde ranges (~1.2.3)\n- Comparison ranges (\u003e=1.2.7 \u003c1.3.0)\n- Hyphen ranges (1.2.3 - 2.3.4)\n- Complex logical operators\n\n## Project Structure\n\n```\nsemver-benchmarks/\n├── benchmarks/\n│   ├── index.js          # Main benchmark suite\n│   ├── parsing.js        # Parsing benchmarks\n│   ├── comparison.js     # Comparison benchmarks\n│   └── satisfies.js      # Satisfies benchmarks\n├── test/\n│   └── test.js          # Compatibility tests\n├── run-hyperfine.sh     # Hyperfine benchmark script\n├── package.json         # Project configuration\n└── README.md           # This file\n```\n\n## Contributing\n\nFeel free to add more test cases, additional libraries, or improve the benchmark methodology.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvltpkg%2Fbenchmarks-semver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvltpkg%2Fbenchmarks-semver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvltpkg%2Fbenchmarks-semver/lists"}