Skip to content

Instantly share code, notes, and snippets.

View bluss's full-sized avatar
💭
out of town

bluss bluss

💭
out of town
View GitHub Profile
{0xdc, 0xc4, 0x0f, 0x05, 0x58, 0x01, 0xac, 0xab},
{0x93, 0xca, 0x57, 0x7d, 0xf3, 0x9b, 0xf4, 0xc9},
{0x4d, 0xd4, 0xc7, 0x4d, 0x02, 0x9b, 0xcb, 0x82},
{0xfb, 0xf7, 0xdd, 0xe7, 0xb8, 0x0a, 0xf8, 0x8b},
{0x28, 0x83, 0xd3, 0x88, 0x60, 0x57, 0x75, 0xcf},
{0x67, 0x3b, 0x53, 0x49, 0x2f, 0xd5, 0xf9, 0xde},
{0xa7, 0x22, 0x9f, 0xc5, 0x50, 0x2b, 0x0d, 0xc5},
{0x40, 0x11, 0xb1, 0x9b, 0x98, 0x7d, 0x92, 0xd3},
{0x8e, 0x9a, 0x29, 0x8d, 0x11, 0x95, 0x90, 0x36},
{0xe4, 0x3d, 0x06, 0x6c, 0xb3, 0x8e, 0xa4, 0x25},
@bluss
bluss / 0-zipfail.rs
Last active April 21, 2016 21:13
rustc -C opt-level=3 -C "llvm-args=-x86-asm-syntax=intel" --emit=asm zipfail.rs
#![crate_type="lib"]
// bad
#[no_mangle]
pub fn copy_zip_vec(xs: &Vec<u8>, ys: &mut Vec<u8>) {
for (a, b) in ys.iter_mut().zip(xs.iter()) {
*a = *b;
}
}
/* This code is MIT/Apache-2.0 licensed or whatever you'd like if you ask me.
test shpfx ... bench: 8,433,171 ns/iter (+/- 145,316) = 5843 MB/s
test shpfx_short ... bench: 4,885 ns/iter (+/- 117) = 9852 MB/s
*/
#![feature(test)]
@bluss
bluss / 01-bench
Created September 10, 2016 22:45
Using rustc 1.13.0-nightly (923bac459 2016-09-06) x86-64/linux
#
test clone_str ... bench: 370,601 ns/iter (+/- 14,692) = 2829 MB/s
test clone_vec_from_fn ... bench: 372,835 ns/iter (+/- 38,525) = 2812 MB/s
test clone_vec_from_incremental ... bench: 369,055 ns/iter (+/- 8,690) = 2841 MB/s
test fast_clone_vec ... bench: 374,947 ns/iter (+/- 11,168) = 2796 MB/s
sum:
test bench_cloned ... bench: 60 ns/iter (+/- 0)
test bench_map ... bench: 60 ns/iter (+/- 1)
test bench_pat ... bench: 61 ns/iter (+/- 3)
find string:
test bench_cloned ... bench: 1,129 ns/iter (+/- 72)
test bench_map ... bench: 1,133 ns/iter (+/- 142)
This file has been truncated, but you can view the full file.
; ModuleID = 'quickcheck.cgu-0.rs'
source_filename = "quickcheck.cgu-0.rs"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%str_slice = type { i8*, i64 }
%"3.std::string::String" = type { %"3.std::vec::Vec<u8>" }
%"3.std::vec::Vec<u8>" = type { %"5.alloc::raw_vec::RawVec<u8>", i64 }
%"5.alloc::raw_vec::RawVec<u8>" = type { %"2.std::ptr::Unique<u8>", i64 }
%"2.std::ptr::Unique<u8>" = type { %"2.core::nonzero::NonZero<*const u8>", %"2.std::marker::PhantomData<u8>" }
This file has been truncated, but you can view the full file.
; ModuleID = 'quickcheck.cgu-0.rs'
source_filename = "quickcheck.cgu-0.rs"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%str_slice = type { i8*, i64 }
%"3.std::string::String" = type { %"3.std::vec::Vec<u8>" }
%"3.std::vec::Vec<u8>" = type { %"5.alloc::raw_vec::RawVec<u8>", i64 }
%"5.alloc::raw_vec::RawVec<u8>" = type { %"2.std::ptr::Unique<u8>", i64 }
%"2.std::ptr::Unique<u8>" = type { %"2.core::nonzero::NonZero<*const u8>", %"2.std::marker::PhantomData<u8>" }
This file has been truncated, but you can view the full file.
fn <f64 as arbitrary::Arbitrary>::arbitrary(_1: &mut G) -> f64 {
let mut _0: f64; // return pointer
scope 1 {
let _2: &mut G; // "g" in scope 1 at src/arbitrary.rs:627:26: 627:27
scope 2 {
let _3: usize; // "s" in scope 2 at src/arbitrary.rs:628:13: 628:14
}
}
let mut _4: &G;
let mut _5: &mut G;
use std::ptr;
use std::mem;
struct Node<T> {
index: usize,
parent: *mut Node<T>,
children: [*mut Node<T>; 2],
value: T,
}
; ModuleID = 'bench1.cgu-0.rs'
source_filename = "bench1.cgu-0.rs"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%str_slice = type { i8*, i64 }
%"12.test::Bencher" = type { i64, %"1.std::time::Duration", i64 }
%"1.std::time::Duration" = type { i64, i32 }
%"15.ndarray::ArrayBase<ndarray::ViewRepr<&i32>, (usize, usize)>" = type { %"15.ndarray::ViewRepr<&i32>", i32*, { i64, i64 }, { i64, i64 } }
%"15.ndarray::ViewRepr<&i32>" = type { %"2.std::marker::PhantomData<&i32>" }