{"id":13681905,"url":"https://github.com/hugoduncan/criterium","last_synced_at":"2025-05-13T18:14:29.599Z","repository":{"id":46054631,"uuid":"439317","full_name":"hugoduncan/criterium","owner":"hugoduncan","description":"Benchmarking library for clojure","archived":false,"fork":false,"pushed_at":"2025-02-24T13:34:18.000Z","size":695,"stargazers_count":1205,"open_issues_count":19,"forks_count":54,"subscribers_count":31,"default_branch":"develop","last_synced_at":"2025-05-03T00:45:02.813Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://hugoduncan.github.io/criterium","language":"Clojure","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/hugoduncan.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":"2009-12-16T15:40:35.000Z","updated_at":"2025-04-30T00:23:26.000Z","dependencies_parsed_at":"2025-02-06T19:04:21.755Z","dependency_job_id":"5da7e3ac-b16d-40d9-a409-74600e99dd9e","html_url":"https://github.com/hugoduncan/criterium","commit_stats":{"total_commits":118,"total_committers":17,"mean_commits":"6.9411764705882355","dds":0.2033898305084746,"last_synced_commit":"bb10582ded6de31b4b985dc31d501db604c0e461"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugoduncan%2Fcriterium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugoduncan%2Fcriterium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugoduncan%2Fcriterium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hugoduncan%2Fcriterium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hugoduncan","download_url":"https://codeload.github.com/hugoduncan/criterium/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254000885,"owners_count":21997443,"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-02T13:01:37.602Z","updated_at":"2025-05-13T18:14:29.576Z","avatar_url":"https://github.com/hugoduncan.png","language":"Clojure","funding_links":[],"categories":["Clojure","测试"],"sub_categories":[],"readme":"# Criterium\n\nCriterium measures the computation time of an expression.  It is\ndesigned to address some of the pitfalls of benchmarking, and benchmarking on\nthe JVM in particular.\n\nThis includes:\n\n  * statistical processing of multiple evaluations\n  * inclusion of a warm-up period, designed to allow the JIT compiler to\n    optimise its code\n  * purging of gc before testing, to isolate timings from GC state prior\n    to testing\n  * a final forced GC after testing to estimate impact of cleanup on the\n    timing results\n\n## Installation\n\n### Leiningen\n\nAdd the following to your `:dependencies`:\n\n```clj\n[criterium \"0.4.6\"]\n```\n\n### Maven\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecriterium\u003c/groupId\u003e\n  \u003cartifactId\u003ecriterium\u003c/artifactId\u003e\n  \u003cversion\u003e0.4.6\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Usage\n\nThe top level interface is in `criterium.core`.\n\n    (use 'criterium.core)\n\nUse `bench` to run a benchmark in a simple manner.\n\n```\n(bench (Thread/sleep 1000))\n =\u003e\n                   Execution time mean : 1.000803 sec\n          Execution time std-deviation : 328.501853 us\n         Execution time lower quantile : 1.000068 sec ( 2.5%)\n         Execution time upper quantile : 1.001186 sec (97.5%)\n```\n\nBy default bench is quiet about its progress.  Run `with-progress-reporting` to\nget progress information on `*out*`.\n\n```clj\n(with-progress-reporting (bench (Thread/sleep 1000) :verbose))\n(with-progress-reporting (quick-bench (Thread/sleep 1000) :verbose))\n```\n\nLower level functions are available, that separate benchmark statistic\ngeneration and reporting.\n\n```clj\n(report-result (benchmark (Thread/sleep 1000) {:verbose true}))\n(report-result (quick-benchmark (Thread/sleep 1000)))\n```\n\nNote that results are returned to the user to prevent JIT from recognising that\nthe results are not used.\n\n## Measurement Overhead Estimation\n\nCriterium will automatically estimate a time for its measurement\noverhead.  The estimate is normally made once per session, and is\navailable in the `criterium.core/estimated-overhead-cache` var.\n\nIf the estimation is made while there is a lot of other processing\ngoing on, then benchmarking quick functions may report small negative\ntimes.  You can force a recalculation of the overhead by calling\n`criterium.core/estimated-overhead!`.\n\nIf you want consistency across JVM processes, it might be prudent to\nexplicitly set `criterium.core/estimated-overhead!` to a constant\nvalue.\n\n## References\n\n[API Documentation](http://hugoduncan.github.io/criterium/0.4/api/)\n[Annotated Source](http://hugoduncan.github.io/criterium/0.4/uberdoc.html)\n\nSee [Elliptic Group](http://www.ellipticgroup.com/html/benchmarkingArticle.html)\nfor a Java benchmarking library.  The accompanying article describes many of the\nJVM benchmarking pitfalls.\n\nSee [Criterion](http://hackage.haskell.org/package/criterion) for a Haskell\nbenchmarking library that applies many of the same statistical techniques.\n\n## Todo\n\nSerial correlation detection.\nMultimodal distribution detection.\nUse kernel density estimators?\n\n## Releasing\n\nTo release, run the `release.sh` script.  This requires that you have\ngit-flow enabled your git repository with `git flow init`, and that\nyou have configured your\n[credentials for clojars](https://github.com/technomancy/leiningen/blob/stable/doc/DEPLOY.md).\n\n## YourKit\n\nYourKit is kindly supporting open source projects with its full-featured Java\nProfiler.\n\nYourKit, LLC is the creator of innovative and intelligent tools for profiling\nJava and .NET applications. Take a look at YourKit's leading software products:\n\n* \u003ca href=\"http://www.yourkit.com/java/profiler/index.jsp\"\u003eYourKit Java Profiler\u003c/a\u003e and\n* \u003ca href=\"http://www.yourkit.com/.net/profiler/index.jsp\"\u003eYourKit .NET Profiler\u003c/a\u003e.\n\n## License\n\nLicensed under [EPL](http://www.eclipse.org/legal/epl-v10.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugoduncan%2Fcriterium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhugoduncan%2Fcriterium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugoduncan%2Fcriterium/lists"}