Skip to content

Instantly share code, notes, and snippets.

View gnzlbg's full-sized avatar

gnzlbg gnzlbg

View GitHub Profile
@gnzlbg
gnzlbg / output.txt
Created November 1, 2018 12:47
jemalloc debug background threads
bgt: disabled
name or mib specifies an unknown/invalid value.
name or mib specifies an unknown/invalid value.
name or mib specifies an unknown/invalid value.
@gnzlbg
gnzlbg / test_enable_bg.cpp
Created October 31, 2018 16:20
Test enabling background threads
#include "include/jemalloc/jemalloc.h"
#include <iostream>
// const char *_rjem_malloc_conf = "background_thread:true";
void print_err(int err) {
switch (err) {
case EINVAL: {
std::cout << "newp is not NULL, and newlen is too large or too small. "
"Alternatively, *oldlenp is too large or too small; in this "
@gnzlbg
gnzlbg / all_sse2.asm
Created August 31, 2018 09:19
Performance of all/any mask reductions on SSE2 and SSE4.1
start:
mov ebx, 111 ; Start marker bytes
db 0x64, 0x67, 0x90 ; Start marker bytes
.L2:
;; the all_sse2 implementation starts here:
movdqa xmm0, [rdi]
pmovmskb eax, xmm0
cmp eax, 65535
sete al
mov ebx, 222 ; End marker bytes
@gnzlbg
gnzlbg / a.rs
Last active August 14, 2018 20:46
cargo fmt --all succeeds but --check fails
//! Implements portable horizontal vector min/max reductions.
macro_rules! impl_reduction_min_max {
([$elem_ty:ident; $elem_count:expr]: $id:ident
| $ielem_ty:ident | $test_tt:tt) => {
impl $id {
/// Largest vector element value.
#[inline]
pub fn max_element(self) -> $elem_ty {
#[cfg(not(any(
@gnzlbg
gnzlbg / time-passes.txt
Created August 12, 2018 18:43
time passes
Compiling cfg-if v0.1.4
Compiling nodrop v0.1.12
Compiling packed_simd_vTests v0.1.0 (file:///Users/gnzlbg/projects/sideprojects/packed_simd/crates/vTests)
Compiling interpolate_idents v0.2.5
time: 0.003 parsing
time: 0.000 attributes injection
time: 0.000 recursion limit
time: 0.000 crate injection
time: 0.000 plugin loading
time: 0.000 plugin registration
```^
make[2]: *** [lib/Target/WebAssembly/CMakeFiles/LLVMWebAssemblyCodeGen.dir/WebAssemblyCFGSort.cpp.o] Error 1
make[1]: *** [lib/Target/WebAssembly/CMakeFiles/LLVMWebAssemblyCodeGen.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....```
```/root/llvm/lib/Target/WebAssembly/WebAssemblyCFGSort.cpp:215:17: error: declaration of 'const {anonymous}::Region* {anonymous}::Entry::Region' [-fpermissive]
const Region *Region;
^~~~~~
/root/llvm/lib/Target/WebAssembly/WebAssemblyCFGSort.cpp:41:7: error: changes meaning of 'Region' from 'class {anonymous}::Region' [-fpermissive]
class Region {```
gnzlbg@air[~/p/s/stdsimd/:wasm_simd128]:~/p/s/s/c/wasm-test/$ cargo test --target wasm32-unknown-unknown
Compiling unicode-xid v0.1.0
Compiling version_check v0.1.4
Compiling serde v1.0.71
Compiling wasm-bindgen-shared v0.2.15 (https://github.com/rustwasm/wasm-bindgen#5b935526)
Compiling itoa v0.4.2
Compiling cfg-if v0.1.4
Compiling dtoa v0.4.3
Compiling wasm-bindgen-shared v0.2.15
Compiling futures v0.1.23
@gnzlbg
gnzlbg / log
Created July 25, 2018 13:14
x86_64-apple-ios fails to link, linker call is really long
cargo test --target x86_64-apple-ios
Compiling nodrop v0.1.12
Compiling interpolate_idents v0.2.5
Compiling arrayvec v0.4.7
Compiling packed_simd v0.1.0 (file:///Users/gnzlbg/projects/sideprojects/packed_simd)
error: linking with `cc` failed: exit code: 1
|
= note: "cc" "-arch" "x86_64" "-Wl,-syslibroot" "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk" "-L" "/Users/gnzlbg/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-ios/lib" "/Users/gnzlbg/projects/sideprojects/packed_simd/target/x86_64-apple-ios/debug/deps/packed_simd-d176cd925c59631a.1016ppq3q9uqg6c9.rcgu.o" "/Users/gnzlbg/projects/sideprojects/packed_simd/target/x86_64-apple-ios/debug/deps/packed_simd-d176cd925c59631a.105941ew8yl2f8pw.rcgu.o" "/Users/gnzlbg/projects/sideprojects/packed_simd/target/x86_
source_filename = "example0-8787f43e282added376259c1adb08b80.rs"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
define internal void @_ZN7example12_mm_blend_pd17h671a9f0d97e329d8E(<2 x double>* noalias nocapture sret dereferenceable(16), <2 x double>* noalias nocapture dereferenceable(16) %a, <2 x double>* noalias nocapture dereferenceable(16) %b, i32 %imm2) unnamed_addr #0 {
start:
%_4 = alloca i32, align 4
%1 = and i32 %imm2, 3
store i32 %1, i32* %_4, align 4
%2 = load i32, i32* %_4, align 4
@gnzlbg
gnzlbg / fails.rs
Last active July 5, 2018 12:59
indicatif+crossbeam
#![feature(test)]
extern crate test;
use test::black_box;
extern crate jemallocator;
use jemallocator::Jemalloc;
extern crate indicatif;
use indicatif::{ProgressBar, MultiProgress, ProgressStyle};