This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python3 | |
import sys | |
from hashlib import sha256 | |
def ten_digits_from_u64(n): | |
assert len(str(2**64)) == 20 | |
assert n < 2**64 | |
s = "{:020}".format(n) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Compiling cc v1.0.55 | |
Compiling example v0.1.0 (/home/jacko/tmp/sanitizer_example) | |
warning: src/oops.c:5:12: warning: address of stack memory associated with local variable 'local_array' returned [-Wreturn-stack-address] | |
warning: return local_array; | |
warning: ^~~~~~~~~~~ | |
warning: 1 warning generated. | |
error: linking with `cc` failed: exit code: 1 | |
| | |
= note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/jacko/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/jacko/tmp/sanitizer_example/target/debug/deps/example-9c8dfc3293cab709.29uisxezum6f4udt.rcgu.o" "/home/jacko/tmp/sanitizer_example/target/debug/deps/example-9c8dfc3293cab709.2hvzw3qk092jmz19.rcgu.o" "/home/jacko/tmp/sanitizer_example/target/debug/deps/example-9c8dfc3293cab709.2vwfxc7xli1op523.rcgu.o" "/home/jacko/tmp/sanitizer_example/target/debug/deps/example-9c8dfc3293cab709.2ymvkyqxyu1kfubm.rcgu.o" "/home/jacko/tmp/sanitizer_example/target/debug/deps/example-9c8dfc32 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A micro-optimization of the POWER build described as described by | |
Themris in https://imgur.com/gallery/xoBunR9. Disclaimer, I haven't | |
played the Triforce all the way through yet, so I'm making a lot of this | |
up / leaning on the original guide. Also a mild *item spoiler* below. | |
Observations: | |
1. The choice of Simulacrum at level 6 is a weak point in the POWER | |
build. COURAGE and WISDOM retain it in their final builds, but POWER | |
is going to drop it just 3 levels later. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C:\Users\Jack\pyo3\examples\word-count>cargo +nightly build --release | |
Compiling proc-macro2 v1.0.9 | |
Compiling unicode-xid v0.2.0 | |
Compiling syn v1.0.16 | |
Compiling autocfg v1.0.0 | |
Compiling lazy_static v1.4.0 | |
Compiling cfg-if v0.1.10 | |
Compiling semver-parser v0.7.0 | |
Compiling memchr v2.3.3 | |
Compiling scopeguard v1.1.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
import hashlib | |
import threading | |
def hash_buf(buf): | |
return hashlib.sha256(buf).hexdigest() | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/hex" | |
"fmt" | |
"io" | |
"os" | |
"github.com/zeebo/blake3" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# dmidecode 3.2 | |
Getting SMBIOS data from sysfs. | |
SMBIOS 3.2.1 present. | |
# SMBIOS implementations newer than version 3.2.0 are not | |
# fully supported by this version of dmidecode. | |
Handle 0x0052, DMI type 16, 23 bytes | |
Physical Memory Array | |
Location: System Board Or Motherboard | |
Use: System Memory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn ticks() -> u64 { | |
let mut discard = 0; | |
unsafe { core::arch::x86_64::__rdtscp(&mut discard) } | |
} | |
fn main() { | |
let t0 = std::time::Instant::now(); | |
let c0 = ticks(); | |
std::thread::sleep(std::time::Duration::from_secs(1)); | |
let t1 = std::time::Instant::now(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sodium.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
int main() { | |
if (sodium_init() < 0) { | |
printf("init error\n"); | |
return 1; | |
} | |
unsigned char hash[crypto_generichash_BYTES]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWS t3.nano (AVX-512) | |
===================== | |
# baokeshed | |
test bench_compress64_portable ... bench: 117 ns/iter (+/- 4) = 1094 MB/s | |
test bench_compress_portable ... bench: 84 ns/iter (+/- 3) = 761 MB/s | |
test bench_compress_sse41 ... bench: 69 ns/iter (+/- 2) = 927 MB/s | |
test bench_fficompress64_portable ... bench: 105 ns/iter (+/- 2) = 1219 MB/s | |
test bench_fficompress_avx512 ... bench: 59 ns/iter (+/- 1) = 1084 MB/s | |
test bench_fficompress_portable ... bench: 93 ns/iter (+/- 4) = 688 MB/s |