mirror of
https://codeberg.org/Mo8it/dotfiles.git
synced 2024-12-02 23:33:05 +00:00
Add divan function
This commit is contained in:
parent
0524076c8b
commit
67dc43a5b6
1 changed files with 48 additions and 0 deletions
|
@ -51,4 +51,52 @@ if status is-interactive
|
|||
if test -f $private_config
|
||||
source $private_config
|
||||
end
|
||||
|
||||
function divan
|
||||
cd ~/code/tmp
|
||||
rm -r benchmark
|
||||
mkdir benchmark
|
||||
cd benchmark
|
||||
|
||||
echo "target/
|
||||
.ignore
|
||||
Cargo.lock" >.ignore
|
||||
|
||||
echo '[package]
|
||||
name = "benchmark"
|
||||
version = "0.0.0"
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
[profile.release]
|
||||
panic = "abort"
|
||||
|
||||
[dev-dependencies]
|
||||
divan = "0.1"
|
||||
|
||||
[[bench]]
|
||||
name = "divan"
|
||||
harness = false' >Cargo.toml
|
||||
|
||||
mkdir src
|
||||
touch src/lib.rs
|
||||
|
||||
mkdir benches
|
||||
echo 'use divan::bench;
|
||||
use std::hint::black_box as bb;
|
||||
|
||||
fn main() {
|
||||
divan::main();
|
||||
}
|
||||
|
||||
#[bench]
|
||||
fn bench() {
|
||||
todo!()
|
||||
}' >benches/divan.rs
|
||||
|
||||
echo 'target
|
||||
Cargo.lock' >.ignore
|
||||
|
||||
hx benches/divan.rs
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue