{"id":16235666,"url":"https://github.com/thebigsasha/runtimetester","last_synced_at":"2025-03-19T15:30:45.423Z","repository":{"id":51378817,"uuid":"304453849","full_name":"TheBigSasha/RuntimeTester","owner":"TheBigSasha","description":"Graphs runtime efficiency of various methods reflexively","archived":false,"fork":false,"pushed_at":"2023-03-15T18:47:51.000Z","size":5956,"stargazers_count":3,"open_issues_count":2,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-17T08:44:04.653Z","etag":null,"topics":["demo","gradle","java","javafx","library","reflection","speedtest","testing","time-complexity","time-efficient","visualization"],"latest_commit_sha":null,"homepage":"https://thebigsasha.github.io/RuntimeTester/","language":"Java","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/TheBigSasha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2020-10-15T21:38:39.000Z","updated_at":"2022-12-06T19:49:50.000Z","dependencies_parsed_at":"2024-10-27T20:53:16.562Z","dependency_job_id":"ee79e1ae-93f6-444e-b778-c6ae2ec2bb88","html_url":"https://github.com/TheBigSasha/RuntimeTester","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheBigSasha%2FRuntimeTester","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheBigSasha%2FRuntimeTester/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheBigSasha%2FRuntimeTester/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheBigSasha%2FRuntimeTester/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheBigSasha","download_url":"https://codeload.github.com/TheBigSasha/RuntimeTester/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244453757,"owners_count":20455279,"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":["demo","gradle","java","javafx","library","reflection","speedtest","testing","time-complexity","time-efficient","visualization"],"created_at":"2024-10-10T13:27:05.258Z","updated_at":"2025-03-19T15:30:44.999Z","avatar_url":"https://github.com/TheBigSasha.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java Library to plot the Time Complexity of methods!\n### Download the latest .jar from the [\"Releases\"](https://github.com/TheBigSasha/RuntimeTester/releases)\nYou should use the .jar compiled for your operating system (RuntimeTester-windows.jar, RuntimeTester-MacOS.jar, or RuntimeTester-Unix.jar), or compile this project using shadowJAR for your OS if it is not one of those 3.\n\n## 📚 Library Installation\nAdd the latest .jar from the [releases](https://github.com/TheBigSasha/RuntimeTester/releases) as a library to your Java IDE:\n\n### IntelliJ IDEA\n#### [Video Guides](https://www.youtube.com/watch?v=FBoE2F2152s\u0026list=PLFvevpoGcNCs0p6QQOEASIuCRwDJAeioA\u0026ab_channel=COMP250) \n##### Click on: ```File -\u003e Project Structure -\u003e Project Settings -\u003e Libraries -\u003e + -\u003e Java -\u003e (navigate to and select RuntimeTester.jar)```\n\n### Eclipse\n#### [Video Guides](https://www.youtube.com/watch?v=dofSJCqE9qE\u0026list=PLFvevpoGcNCs5z8OeGYkws02bBrfeonVP\u0026ab_channel=COMP250)\n##### Right click on your project ``` -\u003e Build Path -\u003e Libraries -\u003e Classpath -\u003e Add External JARs... -\u003e (navigate to and select RuntimeTester.jar)```!\n\n## 💻 Usage\nFor a complete example, see the [sample project](https://github.com/TheBigSasha/RuntimeTester_DemoProject)\n\n### 🚀 Launching the GUI\nTo launch the GUI with the default demos,\n```java\nimport RuntimeTester.*;\npublic class MyClass{\n  public static void main(String args[]){\n      Visualizer.launch(MyClass.class);  //This line initializes and starts the GUI application. The class(es) you pass as parameters will be scanned for test methods.\n  }\n}\n```\n### 🧠 Adding your own method\nTo add your own test methods, use the @benchmark() annotation, as below:\n```java\n@benchmark(name = \"hello world\")                      //The @benchmark annotation has a required property \"name\", all others are optional\npublic static long testMethod(long input){            //All benchmark methods must be public, take long, return long\n    //My-code-here\n}\n```\n**Every custom test method must:**\n  be _public_ so it can be called by the library\n  be _static_ so that it can be called without instantiation\n  _return long_ so that it can be plotted on the y axis\n  _take long as the only parameter_ so it can be plotted on the x axis\n  \n Here is a sample method which plots the curve of n^2\n ```java\n    @benchmark(name = \"sort\", expectedEfficiency = \"o(n^2)\", category = \"Math demos\", theoretical = true)\n    public static long nSquared(long size) {          //There is no restriction on method name\n        return Math.round(Math.pow(size , 2));        //The x axis plots size and the y axis plots what is returned\n    }\n ```\n\n### 🏎️ Benchmarking real methods\nUse the long parameter to indicate the number of items in your data structure\n\nHere is a demo testing Java's built in sorting algorithm\n\n ```java\n    @benchmark(name = \"ArrayList.sort\", expectedEfficiency = \"O(n log(n))\", category = \"Java Builtin\")\n    public static long arraysSort(long size) {\n        ArrayList\u003cDate\u003e dataset = new ArrayList\u003c\u003e();\n        for (long i = 0; i \u003c size; i++) {\n            dataset.add(nextDate());              //nextDate() is a method which randonly generates Java.Util.Date\n                                                  //objects, for which you can find source code in the demonstration\n                                                  //repository for this library (link below)\n        }\n        long startTime = System.nanoTime();       //This indicates when the timer on the method starts\n        dataset.sort(Date::compareTo);\n        long endTime = System.nanoTime();         //This indicates where the timer on the method ends\n        return endTime - startTime;\n    }\n```\n\n* if your method cannot run on more than an int amount of data, simply downcast the float input to int *\n\nThe general practice is:\n\n  _Fill your dataset with N items\n  store a startTime with System.nanoTime();\n  Run your method\n  store an endTime with System.nanoTime();\n  return endTime - startTime_\n\n## 📷 Screenshots and Expected Behaviour\n\n![](https://sashaphotoca.files.wordpress.com/2020/10/2020-10-19-12_19_36-runtime-efficiency-wizard-comp250.png)\n![](https://sashaphotoca.files.wordpress.com/2020/10/2020-10-19-12_18_06-runtime-efficiency-wizard-comp250.png)\n![](https://sashaphotoca.files.wordpress.com/2020/10/2020-10-19-12_07_26-runtime-efficiency-wizard-comp250.png)\n\n## 📁 Cloning as a Gradle project\n### IntelliJ IDEA\nClick on VCS -\u003e get from version control -\u003e paste the link for this repository -\u003e run with Gradle\n\n## 💖 Contributing, Contact, and Feedback\nDev contact: alexander.aleshchenko@mail.mcgill.ca\nWebsite: sashaphoto.ca\nContributing: read contributing.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthebigsasha%2Fruntimetester","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthebigsasha%2Fruntimetester","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthebigsasha%2Fruntimetester/lists"}