{"id":17685743,"url":"https://github.com/neved4/pdksh-perf","last_synced_at":"2025-03-30T20:25:28.443Z","repository":{"id":201088252,"uuid":"706938084","full_name":"Neved4/pdksh-perf","owner":"Neved4","description":"💡 Performance differences in pdksh-derived shells ","archived":false,"fork":false,"pushed_at":"2023-10-24T11:27:54.000Z","size":2,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-05T23:25:37.244Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","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/Neved4.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-10-18T22:30:32.000Z","updated_at":"2024-05-26T20:50:21.000Z","dependencies_parsed_at":"2023-10-24T12:27:12.298Z","dependency_job_id":null,"html_url":"https://github.com/Neved4/pdksh-perf","commit_stats":null,"previous_names":["neved4/pdksh-perf"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neved4%2Fpdksh-perf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neved4%2Fpdksh-perf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neved4%2Fpdksh-perf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Neved4%2Fpdksh-perf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Neved4","download_url":"https://codeload.github.com/Neved4/pdksh-perf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246375429,"owners_count":20767109,"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-10-24T10:28:55.032Z","updated_at":"2025-03-30T20:25:28.420Z","avatar_url":"https://github.com/Neved4.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `pdksh-perf` - printf performance in `oksh`, `mksh`, `posh`\n\nSome performance differences in `pdksh`-derived shells.\n\n### Getting Started\n\nTo benchmark these, install [`hyperfine`], then run:\n\n```sh\nfor i in mksh oksh\ndo\n    hyperfine -w32 -r64 -S none --sort mean-time -L shell $i \\\n      '{shell} ./bg_for.ksh' '{shell} ./bg_printf.ksh' '{shell} ./bg_while.ksh'\ndone\n```\n\n#### Output\n\n```log\nSummary\n  mksh ./bg_for.ksh ran\n    1.04 ± 0.08 times faster than mksh ./bg_while.ksh\n    4.04 ± 0.25 times faster than mksh ./bg_printf.ksh\n\n  oksh ./bg_for.ksh ran\n    1.01 ± 0.07 times faster than oksh ./bg_while.ksh\n    2.20 ± 0.14 times faster than oksh ./bg_printf.ksh\n```\n\nThese benchmarks can be reproduced in `oksh 7.3` and `mksh 59c`. The `posh 0.14.1` shell lacks a built-in `print`. All of them come originally from `pdksh`.\n\nWithout using the `print` built-in, execution slows down by a factor of 3X. With a more [detailed table], execution drops significantly to **[110X times slower]**. These disparities disappeared once the `print` function was introduced.\n\n[`hyperfine`]: https://github.com/sharkdp/hyperfine/tree/master\n[detailed table]: https://github.com/Neved4/color.sh/blob/main/src/color.sh\n[110X times slower]: https://github.com/Neved4/color.sh/blob/main/src/bench.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneved4%2Fpdksh-perf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneved4%2Fpdksh-perf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneved4%2Fpdksh-perf/lists"}