{"id":22937705,"url":"https://github.com/ryanoutcome20/benchmark-toolkit","last_synced_at":"2025-04-01T19:30:12.483Z","repository":{"id":267385219,"uuid":"899400767","full_name":"ryanoutcome20/Benchmark-Toolkit","owner":"ryanoutcome20","description":"Benchmark Toolkit (BTK) is a utility library to test the optimization of functions under specific conditions.","archived":false,"fork":false,"pushed_at":"2024-12-10T02:45:07.000Z","size":29,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-07T12:38:36.943Z","etag":null,"topics":["benchmark","benchmarking","garrys-mod","garrysmod","lua"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryanoutcome20.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":"2024-12-06T07:30:41.000Z","updated_at":"2024-12-07T05:41:31.000Z","dependencies_parsed_at":"2024-12-10T03:26:21.165Z","dependency_job_id":"01be37c1-83f6-424b-95ea-8cc8d836103b","html_url":"https://github.com/ryanoutcome20/Benchmark-Toolkit","commit_stats":null,"previous_names":["ryanoutcome20/benchmark-toolkit"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanoutcome20%2FBenchmark-Toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanoutcome20%2FBenchmark-Toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanoutcome20%2FBenchmark-Toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanoutcome20%2FBenchmark-Toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanoutcome20","download_url":"https://codeload.github.com/ryanoutcome20/Benchmark-Toolkit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246699979,"owners_count":20819803,"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":["benchmark","benchmarking","garrys-mod","garrysmod","lua"],"created_at":"2024-12-14T12:14:04.899Z","updated_at":"2025-04-01T19:30:12.440Z","avatar_url":"https://github.com/ryanoutcome20.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Benchmark-Toolkit\n\nA utility and development library for benchmarking under specific conditions. For an addon version see the [addon branch](https://github.com/ryanoutcome20/Benchmark-Toolkit/tree/addon) of this repository or the [releases tab](https://github.com/ryanoutcome20/Benchmark-Toolkit/releases/).\n\n## Features\n   - **Dynamic Memory \u0026 Timing Statistics**: Provides dynamic memory and timing statistics with easy-to-understand output.\n   - **Customizable Configuration Options**: Easily modify configuration settings on the fly using console variables.\n   - **Easily Utilized Functions \u0026 Commands**: Includes multiple API functions and an easy-to-use console command interface.\n\n## Getting Started\n\n### Prerequisites\n\nThis library is exclusive to Garry's Mod, and you are expected to have a baseline understanding of the following:\n\n- [Garry's Mod](https://store.steampowered.com/app/4000/Garrys_Mod/).\n- Basic knowledge of [Lua 5.1](https://lua.org/).\n- Basic knowledge of [LuaJIT 2.0.4](https://luajit.org/).\n\n### Installation\n\nYou can install by embedding in an already existing addon or by:\n\n1. Cloning the repository:\n   ```bash\n   git clone https://github.com/ryanoutcome20/Benchmark-Toolkit.git\n   ```\n2. Dragging the source Lua file into the directory: \"*Steam\\steamapps\\common\\GarrysMod\\garrysmod\\lua*\".\n3. Executing the code via the console command: \"*lua_openscript_cl benchtk.lua*\" or \"*lua_openscript benchtk.lua*\".\n\n### User Usage\n\nThere are a few console variables you can access:\n\n- `btk_count`: This variable will control the amount of times to run the code or file.\n- `btk_decimals`: This variable will control the precision of the rounding on both garbage and timings.\n\nThere are a few console commands you can use these console commands (suffix cl for clientside)::\n\n- `btk_openscript`: This will benchmark a script relative to the Lua folder.\n- `btk_run`: Runs code direct from the command line.\n- `btk_copy`: Copies your last benchmark results to clipboard in JSON format.\n- `btk_demo`: Runs a demo to showcase how the benchmark results look.\n- `btk_exec`: Executes a function relative to the global variable table (if you don't know what this is then it is best to ignore it).\n\n### Developer Usage\n\nThe API offers several functions, and the entire table is globalized and returned at the end of the file (BTK). I **highly** recommend you take a look inside of the file to get a feel of how everything functions (as there is extensive documentation available inside of the file). A few notable functions are:\n\n- `BTK:Boot(function Func, vararg ...)`: Runs the main benchmarking process.  \n  - Modify console variables via the `Console` table or `RunConsoleCommand`.  \n  - Returns a summary.\n- `BTK:Last()`: Generates and returns the summary of the last benchmark cycle.\n\n### Example\n\nHere’s a simple example of benchmarking a function:\n\n```lua\nlocal function Sample( )\n    -- Returns a sum from 1-1000\n\n    local x = 0\n\n    for i = 1, 1000 do\n        x = x + i\n    end\nend\n\nBTK:Boot( Sample )\n```\n\n### Contributing\n\nContributions are welcome! To suggest or add a new feature, submit an issue or pull request.\n\n## License\n\nThis project is licensed under the GNU General Public License v3.0 - see the [LICENSE](./LICENSE) file for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanoutcome20%2Fbenchmark-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanoutcome20%2Fbenchmark-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanoutcome20%2Fbenchmark-toolkit/lists"}