{"id":13537246,"url":"https://github.com/zombieleet/furious-bash","last_synced_at":"2025-04-02T04:30:27.216Z","repository":{"id":86824807,"uuid":"82481946","full_name":"zombieleet/furious-bash","owner":"zombieleet","description":" Furious is a bash script that benchmarks bunch of functions, and gives you the ability to be able to extract the fastest or slowest function","archived":false,"fork":false,"pushed_at":"2022-03-18T16:59:40.000Z","size":12,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-03T02:32:45.392Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/zombieleet.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":"2017-02-19T18:58:21.000Z","updated_at":"2024-08-09T12:36:52.000Z","dependencies_parsed_at":"2023-07-16T13:24:36.949Z","dependency_job_id":null,"html_url":"https://github.com/zombieleet/furious-bash","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zombieleet%2Ffurious-bash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zombieleet%2Ffurious-bash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zombieleet%2Ffurious-bash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zombieleet%2Ffurious-bash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zombieleet","download_url":"https://codeload.github.com/zombieleet/furious-bash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246756765,"owners_count":20828762,"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-08-01T09:00:56.764Z","updated_at":"2025-04-02T04:30:27.211Z","avatar_url":"https://github.com/zombieleet.png","language":"Shell","readme":"# Furious\n\n### Furious is a bash script that benchmarks bunch of functions, and gives you the ability to be able to extract the fastest or slowest function\n\n\n# Usage\n\nfurious supports the following subcommands\n\n1. add\n2. run\n3. complete\n4. pluck\n5. unset\n\n### add\n\nThe add subcommand supports two argument.The first argument is a function name ( if the function have argument wrap the first argument in double quotes, if an argument to that function contains space wrap it in single quote), the second argument is the name of the function ( just say tag ), it is important you specify that argument\n\n\n**example**\n\n```bash\n\n    function love() {\n        printf \"love???\"\n    }\n\n```\n`furious add love \"whatIsLove\"`\n\n\n### run\n\nThe run subcommand should be called after you are done adding functions to benchmark,\nif this subcommand is not called, you will not be able to use the ***complete*** and ***pluck*** subcommand,\n\n\n`furious run`\n\n### complete\n\nThis subcommand takes just a single argument, which is a function name, behind the scene **furious* passes just a single argument to it, which is an array of the test result\n\n```bash\n\n    function outputAll() {\n        for i ;do\n            echo \"$i\"\n        done\n    }\n\n```\n\n`furious complete outputAll`\n\n\n### pluck\n\nThis subcommand takes a single argument, which is either ***fastest*** or ***slowest***\n\n***fastest***  when you passin fastest as an argument to pluck, it extracts the tagname of the fastest function\n\n***slowest** when you passin slowest as an argument to pluck, it extracts the tagname of the slowest function\n\n`furious pluck fastest`\n\n`furious pluck slowest`\n\n\n### unset\n\nThis subcommand removes the previously added function, this subcommand is useful if you want to do multiple benchmark of several function without a particular group of function affecting another group\n\n\n\n\n# Usage-2\n\nclone the repo\n\u003e\u003e git clone https://github.com/zombieleet/furious-bash.git\n\n\nafter cloning this repo with  ***Furious*** in the script that contains the functions you want to test\n\n```bash\n\n    source ./furious.bash\n\n    seqLoop() {\n        for i in `seq 1 1000`;do\n        echo $i;\n        done\n\n    }\n    cstyleLoop() {\n        for ((i=0;i\u003c=1000;i=i+1)) {\n            echo $i;\n        }\n\n    }\n    builtinLoop() {\n\n        for i in {1..1000};do\n        echo $i\n        done\n    }\n\n    cc() {\n        for i ;do\n        echo $i\n        done\n    }\n\n\n    builtinList() {\n        for i in *;do\n        echo $i\n        done\n    }\n\n    lsStyle() {\n        for i in $(ls);do\n        echo $i\n        done\n    }\n\n\n    furious add seqLoop \"seq\"\n    furious add cstyleLoop \"cstyle\"\n    furious add builtinLoop \"builtin\"\n\n    furious run\n    #furious complete cc\n    printf \"\\n\\nslowest  \"\n    furious pluck slowest\n\n    printf \"\\n\\nfastest \"\n    furious pluck fastest\n\n    furious unset\n\n    furious add builtinList \"builtin\"\n    furious add lsStyle \"lsstyle\"\n\n    furious run\n\n    #furious complete cc\n\n    printf \"\\n\\nslowest  \"\n    furious pluck slowest\n\n    printf \"\\n\\nfastest  \"\n    furious pluck fastest\n\n\n```\n\nnotice what happens after we called `furious unset`\n\n\n\n\n\n\n***unit testing makes it cooler***\n\n```bash\n\n    source ./testify.bash\n    source ./furious.bash\n\n    seqLoop() {\n        for i in `seq 1 1000`;do\n        echo $i;\n        done\n\n    }\n    cstyleLoop() {\n        for ((i=0;i\u003c=1000;i=i+1)) {\n            echo $i;\n        }\n\n    }\n    builtinLoop() {\n\n        for i in {1..1000};do\n        echo $i\n        done\n    }\n\n    cc() {\n        for i ;do\n        echo $i\n        done\n    }\n\n\n    builtinList() {\n        for i in *;do\n        echo $i\n        done\n    }\n\n    lsStyle() {\n        for i in $(ls);do\n        echo $i\n        done\n    }\n\n\n    furious add seqLoop \"seq\"\n    furious add cstyleLoop \"cstyle\"\n    furious add builtinLoop \"builtin\"\n\n    furious run\n    furious complete cc\n    printf \"slowest  \"\n    furious pluck slowest\n\n    printf \"fastest \"\n    furious pluck fastest\n\n    assert expect \"$(furious pluck 'fastest')\" \"builtin\" \"Test for Fastest Runner\" \"This test should pass\"\n    assert expect \"$(furious pluck 'slowest')\" \"cstyle\" \"Test for Slowest Runner\" \"This test should pass\"\n\n    furious unset\n\n    furious add builtinList \"builtin\"\n    furious add lsStyle \"lsstyle\"\n\n    furious run\n\n    furious complete cc\n\n    printf \"slowest  \"\n    furious pluck slowest\n\n    printf \"fastest  \"\n    furious pluck fastest\n\n    assert expect \"$(furious pluck 'fastest')\" \"builtin\" \"Test for Fastest Runner\" \"This should pass\"\n    assert expect \"$(furious pluck 'slowest')\" \"lsstyle\" \"Test for Slowest Runner\" \"This should pass\"\n\n    assert done\n\n\n\n```\n\n# License\n\n   This program is free software; you can redistribute it and/or modify\n   it under the terms of the GNU General Public License as published by\n   the Free Software Foundation; either version 2 of the License, or\n   (at your option) any later version.\n","funding_links":[],"categories":["Helper Function Things"],"sub_categories":["Reusable Things"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzombieleet%2Ffurious-bash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzombieleet%2Ffurious-bash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzombieleet%2Ffurious-bash/lists"}