{"id":20705765,"url":"https://github.com/chuahou/yes","last_synced_at":"2026-04-08T20:51:44.265Z","repository":{"id":107185824,"uuid":"269269904","full_name":"chuahou/yes","owner":"chuahou","description":"A series of implementations of the simplest form of yes","archived":false,"fork":false,"pushed_at":"2020-12-17T11:05:26.000Z","size":8,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-09T08:10:34.540Z","etag":null,"topics":["bash","c","haskell","sh","shell","yes"],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chuahou.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"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,"zenodo":null}},"created_at":"2020-06-04T05:36:32.000Z","updated_at":"2020-12-17T11:05:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"d2cd4fad-275d-4e10-a95f-0c072bde6bb1","html_url":"https://github.com/chuahou/yes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chuahou/yes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuahou%2Fyes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuahou%2Fyes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuahou%2Fyes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuahou%2Fyes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chuahou","download_url":"https://codeload.github.com/chuahou/yes/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chuahou%2Fyes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31573788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["bash","c","haskell","sh","shell","yes"],"created_at":"2024-11-17T01:19:41.060Z","updated_at":"2026-04-08T20:51:44.247Z","avatar_url":"https://github.com/chuahou.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"######################\nRandom yes experiments\n######################\n\n|License: MIT|\n\nA series of implementations of the simplest form of ``yes``, outputting\nan endless loop of ``y\\n``.\n\nInspired by, and C solutions based on, `this Reddit post\n\u003chttps://www.reddit.com/r/unix/comments/6gxduc/how_is_gnu_yes_so_fast/\u003e`_.\n\n``hsbyte`` based on `this Reddit comment\n\u003chttps://www.reddit.com/r/programming/comments/6gxf02/how_is_gnus_yes_so_fast_xpost_runix/diufu49/\u003e`_.\n\nUsage\n======\n\nTo compile, simply run\n::\n\n\tmake\n\nTo run a specific test, run\n::\n\n\t./speedtest.sh [test]\n\nTo see the list of compiled tests, just run\n::\n\n\t./speedtest.sh\n\nTo test GNU yes, or the yes installed on your system, run\n::\n\n\tyes | pv \u003e /dev/null\n\nResults\n=======\n\nThese results are **completely not rigorous**. Each test was only run\nonce for a total of 5 seconds each, which I believe was sufficient\nenough to see the improvements in each.\n\nThe percentages for each speed is of the speed of the intial test of\nGNU yes.\n\nGNU yes\n-------\nyes\n\t5.53 GiB/s\n\nBash scripts\n------------\nsh.sh (``echo \"y\"``)\n\t593 KiB/s (0.01%)—There is a lot of overhead from each call to\n\t``echo``.\nshunroll.sh (``echo \"y\\ny\\ny\\n...\"``)\n\t40.1 MiB/s (0.71%)—Less overhead due to less calls to ``echo``,\n\tsince each call prints multiple lines of ``y\\n``.\n\nHaskell (``ghc``)\n------------------\nhs\n\t12.3 MiB/s (0.21%)\nhslist (infinite list)\n\t9.07 MiB/s (0.16%)—Overhead of list usage.\nhsbuf (manual flush every 8192)\n\t196 MiB/s (3.46%)—Vast improvements from manually flushing and\n\tdisabling flushing upon every newline.\nhsbyte (use ``ByteString.Char 8``)\n\t4.08 GiB/s (73.78%)—Extreme improvements from using ``ByteString``\n\tinstead (based on `this Reddit comment\n\t\u003chttps://www.reddit.com/r/programming/comments/6gxf02/how_is_gnus_yes_so_fast_xpost_runix/diufu49/\u003e`_).\n\nC (``gcc -O3 -g``)\n------------------\nc (``printf``)\n\t138 MiB/s (2.44%)\ncputs (``puts``)\n\t203 MiB/s (3.58%)—Savings from not doing unnecessary formatting.\ncbuf (``write`` with buffer size 8192)\n\t5.51 GiB/s (99.64%)—Extreme improvements from taking a leaf out of\n\tGNU yes's book—we write directly using buffer size of 8192.\n\nPrerequisites\n=============\n\n* bash\n* ghc\n* gcc\n* make\n* pv\n* yes (maybe)\n\n.. |License: MIT| image:: https://img.shields.io/badge/License-MIT-yellow.svg\n\t:target: https://opensource.org/licenses/MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchuahou%2Fyes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchuahou%2Fyes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchuahou%2Fyes/lists"}