{"id":26600876,"url":"https://github.com/zoomrmc/countwords_nim","last_synced_at":"2026-05-02T15:36:04.927Z","repository":{"id":81704675,"uuid":"353304189","full_name":"ZoomRmc/countwords_nim","owner":"ZoomRmc","description":"Counting words with Nim","archived":false,"fork":false,"pushed_at":"2022-03-16T08:53:12.000Z","size":1356,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-23T18:48:23.794Z","etag":null,"topics":["counting-words","nim","optimization"],"latest_commit_sha":null,"homepage":"","language":"Nim","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/ZoomRmc.png","metadata":{"files":{"readme":"README.md","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}},"created_at":"2021-03-31T09:42:57.000Z","updated_at":"2024-09-12T13:20:15.000Z","dependencies_parsed_at":"2023-02-28T12:00:56.955Z","dependency_job_id":null,"html_url":"https://github.com/ZoomRmc/countwords_nim","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ZoomRmc/countwords_nim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZoomRmc%2Fcountwords_nim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZoomRmc%2Fcountwords_nim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZoomRmc%2Fcountwords_nim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZoomRmc%2Fcountwords_nim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZoomRmc","download_url":"https://codeload.github.com/ZoomRmc/countwords_nim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZoomRmc%2Fcountwords_nim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32540116,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T12:25:33.646Z","status":"ssl_error","status_checked_at":"2026-05-02T12:24:51.733Z","response_time":132,"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":["counting-words","nim","optimization"],"created_at":"2025-03-23T18:35:55.610Z","updated_at":"2026-05-02T15:36:04.908Z","avatar_url":"https://github.com/ZoomRmc.png","language":"Nim","funding_links":[],"categories":[],"sub_categories":[],"readme":"Beating Go in counting words with Nim.\n\nSee the full original article for context and background: [https://benhoyt.com/writings/count-words/](https://benhoyt.com/writings/count-words/)\n\nOriginal repository [benhoyt/countwords](https://github.com/benhoyt/countwords) is closed for further contributions.\n\n## Details and discussion\nSee the nim-lang forum thread: https://forum.nim-lang.org/t/7926\n\n⚠️ There's a [separate branch with a faster hashing hack](https://github.com/ZoomRmc/countwords_nim/tree/hashrearhatch) applied. See details in the commit messages.\n\n## Status:\n🍾*Mission accomplished!* Currently faster than Go by a factor dependent on input size:\n```\nx1: 19%\nx10: 3.7%\nx50: 1.7%\n```\n\nCode tries to stay close to the same basic algorithm used by most optimized versions from the original repo.\n\nProbably no point running with `--gc:` other than `arc` or `orc`. Last comparison of various included garbage collectors:\n```\narc/orc: 5.6s\nboehm: 5.7s\nmarkAndSweep: 5.9s\nregions: 6.1s\nrefc: 6.4s\n```\n\n## Timing the current implementation\nTo get statistically significant result measure multiple times or use specialized tools like [hyperfine](https://github.com/sharkdp/hyperfine)\n\nRequired:\n- Bash\n- Go\n- Nim\n- Writable /tmp/\n\n```bash\n./test.sh\n```\n\nTo just build the Nim version:\n```bash\nnim c --gc:arc -d:danger --passC:\"-flto\" --passL:\"-flto\" -o:optimized_nim optimized.nim\n```\n\n## Credits\nThe included Go version: [Ben Hoyt](https://github.com/benhoyt) and [Miguel Angel](https://github.com/ntrrg)\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoomrmc%2Fcountwords_nim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzoomrmc%2Fcountwords_nim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoomrmc%2Fcountwords_nim/lists"}