{"id":18019283,"url":"https://github.com/andytill/horsetheperfs","last_synced_at":"2025-04-04T16:28:25.129Z","repository":{"id":34617031,"uuid":"38565922","full_name":"andytill/horsetheperfs","owner":"andytill","description":"Micro benchmarks for erlang","archived":false,"fork":false,"pushed_at":"2015-07-20T12:22:41.000Z","size":168,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-10T02:13:16.472Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Erlang","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/andytill.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}},"created_at":"2015-07-05T11:00:00.000Z","updated_at":"2018-05-29T15:14:12.000Z","dependencies_parsed_at":"2022-08-17T21:05:06.480Z","dependency_job_id":null,"html_url":"https://github.com/andytill/horsetheperfs","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/andytill%2Fhorsetheperfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andytill%2Fhorsetheperfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andytill%2Fhorsetheperfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andytill%2Fhorsetheperfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andytill","download_url":"https://codeload.github.com/andytill/horsetheperfs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247208660,"owners_count":20901604,"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-10-30T05:09:41.754Z","updated_at":"2025-04-04T16:28:25.107Z","avatar_url":"https://github.com/andytill.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Horse the Perfs\n\nHorse the Perfs is infrastructure for micro benchmarks. It provides the test runner, timing and logging for new micro benchmarks so that they can be written efficiently and run in a repeatable way. Lastly, it is a collection of micro benchmarks that can be re-run against new hardware and VM targets. \n\nMost of the interesting stuff is done using a [fork](https://github.com/andytill/horse) the excellent [horse](https://github.com/extend/horse) library.\n\n### How to run\n\nClone and cd to the `horsetheperfs` directory and run:\n\n    make deps perfs\n\nAfter the firse time, only `make perfs` is necessary.\n\n### How to add tests\n\nDetailed information about adding horse tests can be found [there](https://github.com/andytill/horse).\n\nIn short, add a function to a new or existing erlang module in src. The function name must start with `horse_` for it to be picked up by the `horse` test runner.\n\nIf `horse:repeat/2` appears in the function, for example:\n\n```erlang\nhorse_perf_test() -\u003e\n    horse:repeat(100, binary:copy(\u003c\u003c\"hello\"\u003e\u003e)).\n```\n\nThis is transformed by horse parse transform into a call tail recursive function that calls `binary:copy/1` 100 hundred times.\n\nVariables that are created outside of the call to repeat are not accessible because they are not passed to the generated function. For example, the following will not compile.\n\n```erlang\nhorse_perf_test() -\u003e\n    Bin = \u003c\u003c\"hello\"\u003e\u003e,\n    horse:repeat(100, binary:copy(Bin)).\n```\n\nEach horse function is run and timed in its own function so that garbage collection from other tests will not affect the results.\n\n### How to profile tests\n\nTests can be profiled using [eflame](https://github.com/slfritchie/eflame) by changing the first part of the test name from `horse_` to `horse_eflame_`. When this is run using `make perfs` tracing is applied while the test function is executed and a flame graph is generated in the profiling directory.\n\nRunning the test with eflame profiling turned on takes much longer than without, so is only supposed to be temporary for debugging and the test duration is not a useful measurement in itself.  For this reason, the text **PROFILING** is output at the end of the result line to make this obvious.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandytill%2Fhorsetheperfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandytill%2Fhorsetheperfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandytill%2Fhorsetheperfs/lists"}