codspeed-bencher-compat is a Bencher compatibility layer for CodSpeed that
allows seamless integration of Rust’s built-in benchmarking framework with
CodSpeed performance measurement.This crate acts as a drop-in replacement for the standard bencher crate,
maintaining your existing benchmark code while enabling CodSpeed integration.
Bencher is a port of the unstable libtest benchmarking framework. It is not
recommended for new projects, consider using
Divan for new projects as it offers better
ergonomics and features.
This will install the codspeed-bencher-compat crate and rename it to bencher in your Cargo.toml.
This way, you can keep your existing imports and the compatibility layer will take care of the rest.Using the compatibility layer won’t change the behavior of your benchmark suite
and bencher will still run it as usual.If you prefer, you can also install codspeed-bencher-compat as is and change
your imports to use this new crate name.
Let’s start with the example from the
Bencher documentation, creating a
benchmark suite for 2 simple functions (in benches/example.rs):
use bencher::{benchmark_group, benchmark_main, Bencher};fn a(bench: &mut Bencher) { bench.iter(|| { (0..1000).fold(0, |x, y| x + y) })}fn b(bench: &mut Bencher) { const N: usize = 1024; bench.iter(|| { vec![0u8; N] }); bench.bytes = N as u64;}benchmark_group!(benches, a, b);benchmark_main!(benches);
The last step in creating the Bencher benchmark is to add the new benchmark
target in your Cargo.toml:
Cargo.toml
[[bench]]name = "example"harness = false
And that’s it! You can now run your benchmark suite with CodSpeed:
terminal
$ cargo codspeed build Finished release [optimized] target(s) in 0.12s Finished built 1 benchmark suite(s)$ cargo codspeed run Collected 1 benchmark suite(s) to run Running exampleUsing codspeed-bencher-compat v1.0.0 compatibility layerNOTICE: codspeed is enabled, but no performance measurement willbe made since it's running in an unknown environment.Checked: benches/example.rs::a (group: benches)Checked: benches/example.rs::b (group: benches) Done running bencher_example Finished running 1 benchmark suite(s)
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"CodSpeed Docs","description":"Documentation for CodSpeed, the continuous performance testing and optimization platform.","colors":{"primary":"#FC6E39","light":"#FB905C","dark":"#FC6E39"},"logo":{"light":"https://mintcdn.com/codspeed/SEPN15HtEhsaoVwO/assets/logo/light.svg?fit=max\u0026auto=format\u0026n=SEPN15HtEhsaoVwO\u0026q=85\u0026s=18d4dcb12a5617282de2da263e0db993","dark":"https://mintcdn.com/codspeed/SEPN15HtEhsaoVwO/assets/logo/dark.svg?fit=max\u0026auto=format\u0026n=SEPN15HtEhsaoVwO\u0026q=85\u0026s=7c53ba3b03b0620420bb5d1f4ea3c0cd","href":"https://codspeed.io"},"favicon":"https://mintcdn.com/codspeed/SEPN15HtEhsaoVwO/assets/favicon.svg?fit=max\u0026auto=format\u0026n=SEPN15HtEhsaoVwO\u0026q=85\u0026s=0cc9ab603558dbcd3c162f55cd0af677","appearance":{"default":"dark","strict":true},"background":{"decoration":"gradient","color":{"dark":"#09090B"}},"navbar":{"links":[{"icon":"github","href":"https://github.com/CodSpeedHQ/codspeed","label":"GitHub"}],"primary":{"type":"button","label":"Get Started","href":"https://app.codspeed.io/login?flow=get-started"}},"footer":{"socials":{"github":"https://github.com/CodSpeedHQ/codspeed","discord":"https://codspeed.io/discord","linkedin":"https://linkedin.com/company/codspeed","x":"https://x.com/codspeedhq","bluesky":"https://bsky.app/profile/codspeed.io"},"links":[{"header":"Resources","items":[{"label":"Docs","href":"https://codspeed.io/docs"},{"label":"Home","href":"https://codspeed.io/"},{"label":"Blog","href":"https://codspeed.io/blog"},{"label":"GitHub","href":"https://github.com/CodSpeedHQ/codspeed"},{"label":"Changelog","href":"https://codspeed.io/changelog"}]},{"header":"Getting Started","items":[{"label":"Sample Project","href":"https://app.codspeed.io/pydantic/pydantic-core"},{"label":"Explore repositories","href":"https://codspeed.io/explore"},{"label":"Support","href":"mailto:contact@codspeed.io"}]},{"header":"About","items":[{"label":"Careers","href":"https://careers.codspeed.io"},{"label":"Twitter","href":"https://x.com/CodSpeedHQ"},{"label":"Discord","href":"https://codspeed.io/discord"},{"label":"Contact Us","href":"mailto:contact@codspeed.io"},{"label":"Terms","href":"https://codspeed.io/terms"},{"label":"Privacy Policy","href":"https://codspeed.io/privacy"}]}]},"seo":{"metatags":{"canonical":"https://codspeed.io/docs","twitter:card":"summary_large_image","twitter:site":"@codspeedhq","twitter:domain":"codspeed.io"},"indexing":"all"},"fonts":{"family":"Inter"},"styling":{"eyebrows":"breadcrumbs","latex":true},"integrations":{"gtm":{"tagId":"GTM-N2XNSNB7"},"hotjar":{"hjid":"3931281","hjsv":"6"}},"banner":{"content":"With the new **MCP Server** and **Agent Skills**, your AI assistant can now investigate regressions and optimize your code. [See what's new](https://codspeed.io/changelog).","dismissible":true},"contextual":{"options":["copy","chatgpt","claude"],"display":"header"},"navigation":{"global":{"anchors":[{"anchor":"Discord","icon":"discord","href":"https://discord.gg/MxpaCfKSqF"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"codspeed","hasAudioNarration":false,"actualSubdomain":"codspeed","customDomains":["codspeed.io"],"gitSource":{"type":"github","owner":"codspeedhq","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae49f52c69c99d3b7d14cd7","collectionId":"b64a8782-fa8c-4b8c-8283-b2e5516865ab","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae49f52c69c99d3b7d14cd7"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae49f52c69c99d3b7d14cd7","clientVersion":"0.0.4021","searchFilterCounts":[{"language":"default","tag":"Documentation","count":61},{"language":"default","tag":"Get Started","count":20},{"language":"default","tag":"Creating Benchmarks","count":17},{"language":"default","tag":"Integrations","count":14},{"language":"default","tag":"Instruments","count":11},{"language":"default","tag":"Explore Features","count":10},{"language":"default","tag":"Guides","count":10},{"language":"default","tag":"CI Environments","count":10},{"language":"default","tag":"API References","count":8},{"language":"default","tag":"Node.js","count":7}]},"assistantConfig":{"enableAskAiButton":true,"enableAskAiSearchBar":false,"deflection":{"enabled":true,"email":"support@codspeed.io","showHelpButton":true}},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"#topbar-cta-button>a>span{background-color:unset;background-image:linear-gradient(#fc6e39 -16.25%,#d9390e 67.5%)}footer a.text-gray-500{display:none}footer>div{gap:0!important}footer>div>div:nth-child(n+2){display:none}.chat-assistant-floating-input{display:none!important}@font-face{font-family:\"Fira Code\";src:url(https://codspeed.io/docs/fonts/FiraCode-VariableFont_wght.ttf) format(\"truetype\")}code{font-family:\"Fira Code\",monospace}#banner{background-color:#fc6e39!important}#banner,#banner *{color:#09090b!important}#banner a{font-weight:700!important;text-decoration:underline!important}#\\/benchmarks\\/cpp>a>img{background-color:unset}"}],"page":{"pagePath":"reference/codspeed-rust/bencher","slug":"/reference/codspeed-rust/bencher","pageMetadata":{"title":"bencher (libtest) compatibility layer documentation","sidebarTitle":"bencher (libtest)","description":"A compatibility layer for `bencher`, a port of the unstable libtest benchmarking framework","href":"/reference/codspeed-rust/bencher"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_components.p, {\n children: [\"A compatibility layer for \", _jsx(_components.code, {\n children: \"bencher\"\n }), \", a port of the unstable libtest benchmarking framework\"]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Tip,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(`div`,{className:`mint-flex mint-flex-row mint-gap-2 mint-items-center`,children:[_jsx(`a`,{className:`mint-border-none`,target:`_blank`,href:`https://github.com/CodSpeedHQ/codspeed-rust/actions`,children:_jsx(`img`,{className:`mint-my-0`,noZoom:true,src:`https://github.com/CodSpeedHQ/codspeed-rust/workflows/CI/badge.svg`,alt:`CI Status`})}),_jsx(`a`,{className:`mint-border-none`,target:`_blank`,href:`https://crates.io/crates/codspeed-bencher-compat`,children:_jsx(`img`,{className:`mint-my-0`,noZoom:true,src:`https://img.shields.io/crates/v/codspeed-bencher-compat`,alt:`Crates.io Version`})})]}),`\n`,_jsx(Heading,{level:`2`,id:`overview`,children:`Overview`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`codspeed-bencher-compat`}),` is a Bencher compatibility layer for CodSpeed that\nallows seamless integration of Rust’s built-in benchmarking framework with\nCodSpeed performance measurement.`]}),`\n`,_jsxs(_components.p,{children:[`This crate acts as a drop-in replacement for the standard `,_jsx(_components.code,{children:`bencher`}),` crate,\nmaintaining your existing benchmark code while enabling CodSpeed integration.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Bencher is a port of the unstable `,_jsx(_components.code,{children:`libtest`}),` benchmarking framework. It is not\nrecommended for new projects, consider using\n`,_jsx(_components.a,{href:`/reference/codspeed-rust/divan`,children:`Divan`}),` for new projects as it offers better\nergonomics and features.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`installation`,children:`Installation`}),`\n`,_jsxs(_components.p,{children:[`Install the compatibility layer and rename it to `,_jsx(_components.code,{children:`bencher`}),` to maintain\ncompatibility with existing code:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`cargo`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` add`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --dev`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` codspeed-bencher-compat`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --rename`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` bencher`})]}),`\n`]})})}),`\n`,_jsxs(Tip,{children:[_jsxs(_components.p,{children:[`This will install the `,_jsx(_components.code,{children:`codspeed-bencher-compat`}),` crate and rename it to `,_jsx(_components.code,{children:`bencher`}),` in your `,_jsx(_components.code,{children:`Cargo.toml`}),`.\nThis way, you can keep your existing imports and the compatibility layer will take care of the rest.`]}),_jsx(_components.p,{children:`Using the compatibility layer won’t change the behavior of your benchmark suite\nand bencher will still run it as usual.`}),_jsxs(_components.p,{children:[`If you prefer, you can also install `,_jsx(_components.code,{children:`codspeed-bencher-compat`}),` as is and change\nyour imports to use this new crate name.`]})]}),`\n`,_jsx(Heading,{level:`2`,id:`usage`,children:`Usage`}),`\n`,_jsxs(_components.p,{children:[`Let’s start with the example from the\n`,_jsx(_components.a,{href:`https://docs.rs/bencher/latest/bencher/`,children:`Bencher documentation`}),`, creating a\nbenchmark suite for 2 simple functions (in `,_jsx(_components.code,{children:`benches/example.rs`}),`):`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`19`,language:`rust`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`rust`,children:_jsxs(_components.code,{language:`rust`,numberOfLines:`19`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`use`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` bencher`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{benchmark_group, benchmark_main, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`Bencher`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`};`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`fn`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` a`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`bench`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`mut`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Bencher`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` bench`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`iter`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`||`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`..`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`fold`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`|`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`x`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`y`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`|`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` x`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` +`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` y`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`fn`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` b`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`bench`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`mut`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Bencher`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` N`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` usize`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1024`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` bench`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`iter`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`||`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` vec!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`u8`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`; `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`N`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` bench`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`bytes `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` N`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` as`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` u64`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`benchmark_group!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`benches`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`a`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`b`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`benchmark_main!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`benches`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The last step in creating the Bencher benchmark is to add the new benchmark\ntarget in your `,_jsx(_components.code,{children:`Cargo.toml`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:`Cargo.toml`,numberOfLines:`3`,language:`toml`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`toml`,children:_jsxs(_components.code,{language:`toml`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[[`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:`bench`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`name`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"example\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`harness`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` = `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`And that’s it! You can now run your benchmark suite with CodSpeed:`}),`\n`,_jsx(CodeBlock,{filename:`terminal`,icon:`square-terminal`,numberOfLines:`14`,language:`shellsession`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellsession`,children:_jsxs(_components.code,{language:`shellsession`,numberOfLines:`14`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`$ cargo codspeed build`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Finished release [optimized] target(s) in 0.12s`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Finished built 1 benchmark suite(s)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`$ cargo codspeed run`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Collected 1 benchmark suite(s) to run`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Running example`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`Using codspeed-bencher-compat v1.0.0 compatibility layer`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`NOTICE: codspeed is enabled, but no performance measurement will`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`be made since it's running in an unknown environment.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`Checked: benches/example.rs::a (group: benches)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`Checked: benches/example.rs::b (group: benches)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Done running bencher_example`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` Finished running 1 benchmark suite(s)`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`resources`,children:`Resources`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://docs.rs/bencher/latest/bencher/index.html`,children:`Official bencher documentation`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`https://github.com/bluss/bencher`,children:`Official bencher GitHub repository`})}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"bencher (libtest) compatibility layer documentation","sidebarTitle":"bencher (libtest)","description":"A compatibility layer for `bencher`, a port of the unstable libtest benchmarking framework","href":"/reference/codspeed-rust/bencher"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Overview","slug":"overview","depth":2,"children":[]},{"title":"Installation","slug":"installation","depth":2,"children":[]},{"title":"Usage","slug":"usage","depth":2,"children":[]},{"title":"Resources","slug":"resources","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/docs/_mintlify/custom/codspeed/b3eaa496f89f763a/scripts/plausible.js","/docs/_mintlify/custom/codspeed/49a364438b48260b/scripts/crisp.js","/docs/_mintlify/custom/codspeed/908f72e163898697/scripts/mixpanel.js","/docs/_mintlify/custom/codspeed/36100c5f420e7746/scripts/reo.js","/docs/_mintlify/custom/codspeed/818659b90dbf0ae9/scripts/mixpanel-events.js"],"dynamicCss":".mint-my-0 {\n margin-top: 0px;\n margin-bottom: 0px\n}\n.mint-flex {\n display: flex\n}\n.mint-flex-row {\n flex-direction: row\n}\n.mint-items-center {\n align-items: center\n}\n.mint-gap-2 {\n gap: 0.5rem\n}\n.mint-border-none {\n border-style: none\n}","subdomain":"codspeed","siteName":"CodSpeed Docs","title":"bencher (libtest) compatibility layer documentation - CodSpeed Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-24T17:13:58.836Z","originalFileLocation":"reference/codspeed-rust/bencher.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"dark\";if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"A compatibility layer for bencher, a port of the unstable libtest benchmarking framework\">\u003cmeta data-mint-head name=\"application-name\" content=\"CodSpeed Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/codspeed/o6dkItj_FLwvyrIz/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/codspeed/o6dkItj_FLwvyrIz/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/codspeed/o6dkItj_FLwvyrIz/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/codspeed/o6dkItj_FLwvyrIz/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/codspeed/o6dkItj_FLwvyrIz/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/codspeed/o6dkItj_FLwvyrIz/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/codspeed/o6dkItj_FLwvyrIz/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/codspeed/o6dkItj_FLwvyrIz/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/codspeed/o6dkItj_FLwvyrIz/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"bencher (libtest) compatibility layer documentation - CodSpeed Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"A compatibility layer for bencher, a port of the unstable libtest benchmarking framework\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"CodSpeed Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://codspeed.io/docs/reference/codspeed-rust/bencher\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://codspeed.mintlify.app/_mintlify/api/og/v2?division=Compatibility+layers\u0026amp;title=bencher+%28libtest%29+compatibility+layer+documentation\u0026amp;description=A+compatibility+layer+for+%60bencher%60%2C+a+port+of+the+unstable+libtest+benchmarking+framework\u0026amp;theme=6a0ff7cd01762648aac17823\u0026amp;signature=2ffdb3c4c8d489a594e9c42089ab0c7e2d119e1e905935eceb92a69d7e5e262b\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"bencher (libtest) compatibility layer documentation - CodSpeed Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"A compatibility layer for bencher, a port of the unstable libtest benchmarking framework\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://codspeed.mintlify.app/_mintlify/api/og/v2?division=Compatibility+layers\u0026amp;title=bencher+%28libtest%29+compatibility+layer+documentation\u0026amp;description=A+compatibility+layer+for+%60bencher%60%2C+a+port+of+the+unstable+libtest+benchmarking+framework\u0026amp;theme=6a0ff7cd01762648aac17823\u0026amp;signature=2ffdb3c4c8d489a594e9c42089ab0c7e2d119e1e905935eceb92a69d7e5e262b\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/codspeed/o6dkItj_FLwvyrIz/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"CodSpeed Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#FC6E39\">\u003cmeta data-mint-head name=\"twitter:domain\" content=\"codspeed.io\">\u003clink data-mint-head rel=\"canonical\" href=\"https://codspeed.io/docs/reference/codspeed-rust/bencher\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/reference/codspeed-rust/bencher.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://codspeed.io/#organization\",\"name\":\"CodSpeed Docs\",\"url\":\"https://codspeed.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/codspeed/SEPN15HtEhsaoVwO/assets/logo/light.svg?fit=max\u0026auto=format\u0026n=SEPN15HtEhsaoVwO\u0026q=85\u0026s=18d4dcb12a5617282de2da263e0db993\"}},{\"@type\":\"WebSite\",\"@id\":\"https://codspeed.io/docs#website\",\"name\":\"CodSpeed Docs\",\"url\":\"https://codspeed.io/docs\",\"publisher\":{\"@id\":\"https://codspeed.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://codspeed.io/docs/reference/codspeed-rust/bencher#webpage\",\"url\":\"https://codspeed.io/docs/reference/codspeed-rust/bencher\",\"name\":\"bencher (libtest) compatibility layer documentation\",\"description\":\"A compatibility layer for bencher, a port of the unstable libtest benchmarking framework\",\"dateModified\":\"2026-09-24T17:13:58.836Z\",\"isPartOf\":{\"@id\":\"https://codspeed.io/docs#website\"},\"breadcrumb\":{\"@id\":\"https://codspeed.io/docs/reference/codspeed-rust/bencher#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://codspeed.io/docs/reference/codspeed-rust/bencher#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Compatibility layers\",\"item\":\"https://codspeed.io/docs/reference/codspeed-rust/divan\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"bencher (libtest) compatibility layer documentation\",\"item\":\"https://codspeed.io/docs/reference/codspeed-rust/bencher\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://codspeed.io/docs/reference/codspeed-rust/bencher#article\",\"headline\":\"bencher (libtest) compatibility layer documentation\",\"name\":\"bencher (libtest) compatibility layer documentation\",\"description\":\"A compatibility layer for bencher, a port of the unstable libtest benchmarking framework\",\"url\":\"https://codspeed.io/docs/reference/codspeed-rust/bencher\",\"mainEntityOfPage\":{\"@id\":\"https://codspeed.io/docs/reference/codspeed-rust/bencher#webpage\"},\"dateModified\":\"2026-09-24T17:13:58.836Z\",\"publisher\":{\"@id\":\"https://codspeed.io/#organization\"},\"isPartOf\":{\"@id\":\"https://codspeed.io/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"CodSpeed Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"CodSpeed Docs","nav":{"global":{"anchors":[{"anchor":"Discord","icon":"discord","href":"https://discord.gg/MxpaCfKSqF"}]},"tabs":[{"tab":"Documentation","icon":"book","pages":[{"title":"Documentation","href":""}]},{"tab":"Guides","icon":"map","pages":[{"title":"Guides","href":"/guides"}]},{"tab":"API References","icon":"code","dropdowns":[{"dropdown":"API References","icon":"code","pages":[{"title":"API References","sidebarTitle":"Overview","href":"/reference"}]},{"dropdown":"pytest-codspeed","icon":"python","pages":[{"title":"pytest-codspeed documentation","sidebarTitle":"API Reference","href":"/reference/pytest-codspeed"}]},{"dropdown":"codspeed-rust","icon":"rust","pages":[{"title":"codspeed-rust documentation","sidebarTitle":"Home","icon":"house","href":"/reference/codspeed-rust"},{"title":"cargo-codspeed documentation","sidebarTitle":"cargo-codspeed","icon":"cubes","href":"/reference/codspeed-rust/cargo-codspeed"},{"group":"Compatibility layers","icon":"layer-group","pages":[{"title":"divan compatibility layer documentation","sidebarTitle":"divan (recommended)","href":"/reference/codspeed-rust/divan"},{"title":"criterion.rs compatibility layer documentation","sidebarTitle":"criterion.rs","description":"A compatibility layer for `criterion.rs`","href":"/reference/codspeed-rust/criterion"},{"title":"bencher (libtest) compatibility layer documentation","sidebarTitle":"bencher (libtest)","href":"/reference/codspeed-rust/bencher"}]}]}]},{"tab":"Blog","icon":"newspaper","href":"https://codspeed.io/blog"},{"tab":"We're hiring!","icon":"briefcase","href":"https://careers.codspeed.io"}]},"title":"bencher (libtest) compatibility layer documentation - CodSpeed Docs","buildId":"dpl_DGmhKsAzJdVqypJzon18vViniWRY","deploymentId":"dpl_DGmhKsAzJdVqypJzon18vViniWRY","dynamics":["10e4515597"],"chunks":["BannerMarkdown-Db5Nu5n1.js","dist-DN0dCbTw.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","clsx-BOmkPVIU.js","html-void-elements-mCSPHezU.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js"]}