{"id":16307543,"url":"https://github.com/kfly8/bench-perl-class-builder","last_synced_at":"2025-09-30T01:31:53.202Z","repository":{"id":187709567,"uuid":"677354395","full_name":"kfly8/bench-perl-class-builder","owner":"kfly8","description":"Benchmarked new perl class feature with many class builders","archived":false,"fork":false,"pushed_at":"2024-07-09T03:32:47.000Z","size":45,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-01-16T09:12:01.942Z","etag":null,"topics":["perl"],"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/kfly8.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":"2023-08-11T11:11:34.000Z","updated_at":"2024-07-24T12:18:42.000Z","dependencies_parsed_at":"2024-06-10T03:25:43.982Z","dependency_job_id":"4bb9b699-d748-4608-b667-8faac32b814b","html_url":"https://github.com/kfly8/bench-perl-class-builder","commit_stats":{"total_commits":20,"total_committers":2,"mean_commits":10.0,"dds":"0.19999999999999996","last_synced_commit":"f590f2bca706f2081e09f18f7219cd93a2238ad3"},"previous_names":["kfly8/bench-perl-class-builder"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfly8%2Fbench-perl-class-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfly8%2Fbench-perl-class-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfly8%2Fbench-perl-class-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kfly8%2Fbench-perl-class-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kfly8","download_url":"https://codeload.github.com/kfly8/bench-perl-class-builder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234685306,"owners_count":18871441,"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":["perl"],"created_at":"2024-10-10T21:14:32.959Z","updated_at":"2025-09-30T01:31:52.860Z","avatar_url":"https://github.com/kfly8.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n## What's this?\n\n[In Perl 5.38, the class feature was integrated into the core](https://metacpan.org/release/RJBS/perl-5.38.0/view/pod/perldelta.pod), so I compared it with many class builders. Ovid, who is main designer of new class feature, blogged the following:\n\u003e Note that it’s not taking anything away from Perl; it’s adding a core object system for better memory consumption, performance, and elegance.\n\u003e ( https://ovid.github.io/articles/corinna-in-the-perl-core.html )\n\nThe class feature is still in the experimental stage, so I think the results may change depending on future development. \n\nIn the following execution environment, the class feature had the best memory efficiency, and the results of the constructor of an object and access to object fields are equivalent to those of objects blessed with array references.\n\n\n## Execution Environment\n\n```shell\n  ❯ inxi -SCm\n  System:\n    Host: kfly8.local Kernel: 23.1.0 arch: arm64 bits: 64 Console: s006 OS: Darwin 23.1.0\n  Memory:\n    System RAM: total: N/A available: N/A used: N/A\n    RAM Report: missing: Required tool dmidecode not installed. Check --recommends\n  CPU:\n    Info: 10-core model: Apple M2 Pro bits: 64 type: MCP\n    Speed: N/A min/max: N/A cores: No OS support for core speeds.\n```\n\n## Benchmark memory size\n\n| Size     | Compare | Title                                       |\n| ---      | ---     | ---                                         |\n| 135.8 KB | --      | `class feature (perl: 5.040000)`            |\n| 257.9 KB | 89.90%  | `bless arrayref`                            |\n| 265.7 KB | 95.60%  | `Object::Pad@0.808`                         |\n| 359.5 KB | 164.80% | `Mouse@v2.5.10`                             |\n| 359.5 KB | 164.80% | `Moo@2.005005`                              |\n| 359.5 KB | 164.80% | `Moose@2.2207 (XSAccessor)`                 |\n| 359.5 KB | 164.80% | `Object::Tiny@1.09`                         |\n| 359.5 KB | 164.80% | `Moo@2.005005 (XSConstructor + XSAccessor)` |\n| 359.5 KB | 164.80% | `Class::Tiny@1.008`                         |\n| 359.5 KB | 164.80% | `Moose@2.2207`                              |\n| 359.5 KB | 164.80% | `bless hashref`                             |\n| 359.5 KB | 164.80% | `Class::Accessor::Lite@0.08`                |\n\nThis result were calculated using [bench-size.pl](https://github.com/kfly8/bench-perl-class-builder/blob/main/bench-size.pl).\n\n## Benchmark object constructors\n\n| Rate   | Compare | Title                                       |\n| ---    | ---     | ---                                         |\n| 550/s  | -59%    | `Class::Tiny@1.008`                         |\n| 752/s  | -44%    | `Moose@2.2207`                              |\n| 752/s  | -44%    | `Moose@2.2207 (XSAccessor)`                 |\n| 931/s  | -30%    | `Moo@2.005005`                              |\n| 1081/s | -19%    | `Moo@2.005005 (XSConstructor + XSAccessor)` |\n| 1152/s | -14%    | `Mouse@v2.5.10`                             |\n| 1195/s | -10%    | `Object::Pad@0.808`                         |\n| 1334/s | --      | `class feature (perl: 5.040000)`            |\n| 1347/s | 1%      | `bless arrayref`                            |\n| 1674/s | 25%     | `bless hashref`                             |\n| 1690/s | 27%     | `Class::Accessor::Lite@0.08`                |\n| 1729/s | 30%     | `Object::Tiny@1.09`                         |\n\nThis result were calculated using [bench-new.pl](https://github.com/kfly8/bench-perl-class-builder/blob/main/bench-new.pl).\n\n## Benchmark access to object fields\n\n| Rate     | Compare | Title                                       |\n| ---      | ---     | ---                                         |\n| 93699/s  | -26%    | `Object::Pad@0.808`                         |\n| 100485/s | -20%    | `Class::Accessor::Lite@0.08`                |\n| 120302/s | -5%     | `Moo@2.005005`                              |\n| 123675/s | -2%     | `Class::Tiny@1.008`                         |\n| 124842/s | -1%     | `Moose@2.2207`                              |\n| 126030/s | --      | `class feature (perl: 5.040000)`            |\n| 127242/s | 1%      | `bless hashref`                             |\n| 137846/s | 9%      | `bless arrayref`                            |\n| 156038/s | 24%     | `Object::Tiny@1.09`                         |\n| 223418/s | 77%     | `Moose@2.2207 (XSAccessor)`                 |\n| 236307/s | 87%     | `Mouse@v2.5.10`                             |\n| 267962/s | 113%    | `Moo@2.005005 (XSConstructor + XSAccessor)` |\n\nThis result were calculated using [bench-field.pl](https://github.com/kfly8/bench-perl-class-builder/blob/main/bench-field.pl).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkfly8%2Fbench-perl-class-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkfly8%2Fbench-perl-class-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkfly8%2Fbench-perl-class-builder/lists"}