{"id":21355688,"url":"https://github.com/arrmansa/fast-fizzbuzz-python","last_synced_at":"2025-03-16T05:25:17.048Z","repository":{"id":191693479,"uuid":"482371945","full_name":"arrmansa/Fast-FizzBuzz-python","owner":"arrmansa","description":"FizzBuzz implementation in python that outputs to pv \u003e /dev/null.","archived":false,"fork":false,"pushed_at":"2022-04-25T19:36:33.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T18:09:34.906Z","etag":null,"topics":["fizz-buzz","fizzbuzz","fizzbuzz-python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arrmansa.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}},"created_at":"2022-04-16T22:10:44.000Z","updated_at":"2022-04-25T05:29:07.000Z","dependencies_parsed_at":"2023-08-31T07:03:46.840Z","dependency_job_id":"8e181e06-0f40-4a79-b839-e305cd215d88","html_url":"https://github.com/arrmansa/Fast-FizzBuzz-python","commit_stats":null,"previous_names":["arrmansa/fast-fizzbuzz-python"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arrmansa%2FFast-FizzBuzz-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arrmansa%2FFast-FizzBuzz-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arrmansa%2FFast-FizzBuzz-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arrmansa%2FFast-FizzBuzz-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arrmansa","download_url":"https://codeload.github.com/arrmansa/Fast-FizzBuzz-python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243829813,"owners_count":20354727,"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":["fizz-buzz","fizzbuzz","fizzbuzz-python"],"created_at":"2024-11-22T04:19:26.009Z","updated_at":"2025-03-16T05:25:17.026Z","avatar_url":"https://github.com/arrmansa.png","language":"Python","readme":"# Fast-FizzBuzz-python\n\nFor https://codegolf.stackexchange.com/questions/215216/high-throughput-fizz-buzz/. Do check out the awesome submissions by others and the benchmark code is here if you want to run it on your machine https://github.com/omertuc/fizzgolf.\n\n## Usage on google colab\nChange the output number (1e9 for \u003c 2 min runtime) (1e8 for \u003c20 s runtime)\n\n### fizzbuzz_numpy_os.py and fizzbuzz_pure_python.py\n!apt-get install pv \u003cbr /\u003e\n!python3 fizzbuzz_numpy_os.py | pv \u003e /dev/null \u003cbr /\u003e\nor \u003cbr /\u003e\n!python3 fizzbuzz_pure_python.py | pv \u003e /dev/null \u003cbr /\u003e\n\n### fizzbuzz_multiprocessing_numpy_os.py and fizzbuzz_multiprocessing_numpy_os_improvised_lock.py\n\n#install python 3.9 \u003cbr /\u003e\n!sudo apt-get update -y \u003cbr /\u003e\n!sudo apt-get install python3.9 \u003cbr /\u003e\n\n#change alternatives \u003cbr /\u003e\n!sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1 \u003cbr /\u003e\n!sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 2 \u003cbr /\u003e\n\n#check python version \u003cbr /\u003e\n!python --version \u003cbr /\u003e\n\n#Pip\n!apt-get install python3-pip \u003cbr /\u003e\n!apt install python3.9-distutils \u003cbr /\u003e\n!python3 -m pip install --upgrade pip \u003cbr /\u003e\n!pip install numpy \u003cbr /\u003e\n!apt-get install pv \u003cbr /\u003e\n!python3 fizzbuzz_multiprocessing_numpy_os.py | pv \u003e /dev/null \u003cbr /\u003e\n\n## Performance on google collab, length = int(1e9)\n!python3 fizzbuzz_numpy_os.py | pv \u003e /dev/null #chunk 8100\u003cbr /\u003e\n7.33GiB 0:00:59 [ 125MiB/s] [                                     \u003c=\u003e          ] \u003cbr /\u003e\n\u003cbr /\u003e\n!python3 fizzbuzz_pure_python.py | pv \u003e /dev/null #chunk 6000\u003cbr /\u003e\n7.33GiB 0:01:25 [87.5MiB/s] [             \u003c=\u003e                                  ] \u003cbr /\u003e\n \u003cbr /\u003e\n!python3 fizzbuzz_multiprocessing_numpy_os.py | pv \u003e /dev/null #chunk 1500000 \u003cbr /\u003e\n7.34GiB 0:01:27 [85.7MiB/s] [            \u003c=\u003e                                   ] \u003cbr /\u003e\n\n!python3 fizzbuzz_multiprocessing_numpy_os_improvised_lock.py | pv \u003e /dev/null #chunk 1500000 \u003cbr /\u003e\n7.34GiB 0:01:14 [ 100MiB/s] [                        \u003c=\u003e                       ]\n\n## Notes\nfizzbuzz_multiprocessing_numpy_os.py is slow on colab because of the overhead from making new processes. \u003cbr /\u003e\nIf there were more cores and with larger strings it might be possible to overcome this.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farrmansa%2Ffast-fizzbuzz-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farrmansa%2Ffast-fizzbuzz-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farrmansa%2Ffast-fizzbuzz-python/lists"}