{"id":19877482,"url":"https://github.com/bbrtj/perl-validator-benchmark","last_synced_at":"2026-05-25T16:31:47.230Z","repository":{"id":133104490,"uuid":"453190355","full_name":"bbrtj/perl-validator-benchmark","owner":"bbrtj","description":"Benchmark of Perl validation frameworks. Example results -\u003e https://bbrtj.eu/blog/article/validation-frameworks-benchmark","archived":false,"fork":false,"pushed_at":"2025-11-26T17:36:34.000Z","size":344,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-20T05:30:34.324Z","etag":null,"topics":["benchmark","perl","perl5","validation"],"latest_commit_sha":null,"homepage":"","language":"Perl","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/bbrtj.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":"2022-01-28T19:23:09.000Z","updated_at":"2025-11-26T17:36:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"1903f989-f29a-4c01-8d07-0faf196240bd","html_url":"https://github.com/bbrtj/perl-validator-benchmark","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bbrtj/perl-validator-benchmark","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbrtj%2Fperl-validator-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbrtj%2Fperl-validator-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbrtj%2Fperl-validator-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbrtj%2Fperl-validator-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbrtj","download_url":"https://codeload.github.com/bbrtj/perl-validator-benchmark/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbrtj%2Fperl-validator-benchmark/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33483817,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-25T14:31:05.219Z","status":"ssl_error","status_checked_at":"2026-05-25T14:31:02.878Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","perl","perl5","validation"],"created_at":"2024-11-12T16:37:35.184Z","updated_at":"2026-05-25T16:31:47.218Z","avatar_url":"https://github.com/bbrtj.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Benchmarks for form validators\n\nThese benchmarks measure:\n- how fast input hashes matching the specification can be validated at runtime\n\nThese benchmarks don't (currently?) measure:\n- validation failure speed\n- compilation time overhead\n\nObject construction is part of the benchmark, but can be skipped if certain\nvalidator implementation does not require it or is built in a way that makes it\npersistent during its intended workflow.\n\n## Example results\n\n(https://bbrtj.eu/blog/article/validation-frameworks-benchmark)\n\n## Running the benchmark\n\nFirst, you have to install Carmel or Carton for your perl and use it to install dependencies locally:\n\n```\ncpan Carmel\ncarmel install\n```\n\nThe benchmark is run one case at a time:\n\n```\ncarmel exec ./benchmark.pl \u003ccase_name\u003e\n```\n\n## Cases\n\nHere is the list of current benchmark cases with rationales behind them:\n\n### single_field\n\nWe pass a single field `a`, which is required and can be any scalar value.\n\n*Rationale*: we measure the runtime overhead each system has. The validation rule here is as easy as it can be on purpose. Results of this benchmark can be used to decide whether a validator should be used for simple data validation cases that will run very frequently.\n\n### build_object\n\nThe same as `single_field`, but we do not cache the validation object and let it rebuild from scratch.\n\n*Rationale*: we measure the object construction overhead for each system. Some systems may \"cheat\" this benchmark by pinning validation data to the class and not the object. Results of this benchmark can be used to determine which framework is faster in a scenario where the validation object cannot be kept in memory for long-term reuse.\n\n### multiple_fields\n\nWe pass five fields `a`, `b`, `c`, `d`, `e`, all of which are required and strings.\n\n*Rationale*: we can compare results of the previous single_field validator and see how having multiple rules affects validator's performance. A big drop in validation speed can indicate a poorly optimized system.\n\n### array_of_objects\n\nWe pass a single field `a`, which is an array reference of hash references. There are 100 nested hashes in total. Each hash contains keys `b` - a number, and `c` - a string.\n\n*Rationale*: We measure how efficiently validators can crawl a nested structure and whether they can deal with large amount of data. The amount of data can be configured by hand in `BenchmarkSetup` to see whether the performance decreases linearly or exponentially. This data can be used to decide whether a validator is fit for larger volume of data.\n\n## Contributing\n\nContributions are welcome! If you wish to contribute a new validator, follow these steps:\n1. Add your validator module into `cpanfile`. Run `carmel install` to update `cpanfile.snapshot`\n2. Add a new benchmark runner in `lib/Utils.pm`. Name your benchmark `Bench\u003cname\u003e`, `\u003cname\u003e` being module name without `::` separators\n3. Choose which benchmark case you would like to implement. Add your benchmark name into `BenchmarkSetup.pm` file in that directory (in `sub participants`)\n4. Create a file in that directory named `Bench\u003cname\u003e.pm`. Implement validation code in that file\n5. Ensure your validator works, then create a pull request\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbrtj%2Fperl-validator-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbrtj%2Fperl-validator-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbrtj%2Fperl-validator-benchmark/lists"}