1
0
Fork 0

move the benchmarks around a little

This commit is contained in:
edef 2015-01-14 07:01:43 +01:00
parent 0729ca8648
commit 5cf3a35d65
2 changed files with 16 additions and 13 deletions

15
benches/kernel_swap.rs Normal file
View File

@ -0,0 +1,15 @@
#![feature(asm)]
extern crate test;
use test::Bencher;
#[bench]
fn kernel_swap(b: &mut Bencher) {
b.iter(|| unsafe {
asm!("movq $$102, %rax\n\
syscall"
:
:
: "rax", "rcx"
: "volatile");
});
}

View File

@ -1,4 +1,4 @@
#![feature(unboxed_closures, default_type_params, asm)] #![feature(unboxed_closures, default_type_params, box_syntax)]
extern crate test; extern crate test;
extern crate libc; extern crate libc;
extern crate lwkt; extern crate lwkt;
@ -34,15 +34,3 @@ fn swap(b: &mut Bencher) {
Context::swap(&mut native, &mut green); Context::swap(&mut native, &mut green);
}) })
} }
#[bench]
fn kernel_swap(b: &mut Bencher) {
b.iter(|| unsafe {
asm!("movq $$102, %rax\n\
syscall"
:
:
: "rax", "rcx"
: "volatile");
});
}