Skip to content

Instantly share code, notes, and snippets.

package main
import "crypto/aes"
import "fmt"
import "encoding/hex"
var start = []byte("AES-256 ECB mode twice, two keys")
var end = []byte("\x4c\x76\xe9\x07\x86\xc4\xf3\x64\x6a\xdf\x99\x21\x7a\x64\xd0\xd7\x49\xed\xc5\x9f\x2c\x7f\xbb\x36\x58\xaf\x04\xaf\x07\x1d\x0c\x47")
var reverse = make(map[string][32]byte)
[08:43:33] <awreece> what is is a good benchmark for memcached?
[08:44:27] <awreece> https://github.com/antirez/mc-benchmark appears to be several years old, and last I checked there was some disagreement about it
[08:44:55] <awreece> in particular, I want to experiment with a new storage engine
[11:02:50] <dormando> awreece: github.com/dormando/mc-crusher
[11:05:28] <awreece> cool. I'll try this
[11:05:57] <awreece> does it make any attempt to simulate realistic application workloads, or is the general wisdom "every workload is different" ?
[11:06:43] <awreece> (I notice "it only works well with small values")
[11:08:08] <dormando> most workloads are different. mc-crusher lets you set up config files for different types
[11:08:23] <dormando> it's mostly designed to stress the storage engine locks/etc. find the breaking points.
[11:08:48] <awreece> ok
===================== done ====================
pass statistics:
method pass_blank :: 0 worked 2 times and failed 0 times
method pass_lines :: 2 worked 69 times and failed 4885 times
method pass_lines :: 2 worked 69 times and failed 4885 times
method pass_lines :: 2 worked 69 times and failed 4885 times
method pass_lines :: 10 worked 273 times and failed 10689 times
method pass_lines :: 10 worked 273 times and failed 10689 times
method pass_lines :: 10 worked 273 times and failed 10689 times
#include <stdio.h>
#ifdef WITH_UNWIND
#define UNW_LOCAL_ONLY
#include <libunwind.h>
void show_backtrace (void) {
unw_cursor_t cursor; unw_context_t uc;
unw_word_t ip, sp;
# dtrace -n 'syscall:::entry /pid == $target/ {}' -c /Applications/OmniGraffle\ Professional\ 5.app/Contents/MacOS/OmniGraffle\ Professional
dtrace: failed to execute /Applications/OmniGraffle: file is set-id or unreadable [Note: the '-c' option requires a full pathname to the file]
// A simple memory profiler.
//
// Each of the write_memory_* functions read from a 1GB array. Each of the
// write_memory_* writes to the 1GB array. The goal is to get the max memory
// bandwidth as advertised by the intel specs: 25.6 GB/s (http://goo.gl/r8Aab)
//
// Compile with clang -mavx memory_profiler.c
#include <assert.h>
#include <stdlib.h>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <sys/time.h>
// #include <smmintrin.h>
// #include <emmintrin.h>
#define SAMPLES 5
#define SIZE (1024*1024*1024)
$ cat sorted.dat
apropos comma havlak c2d172e0c8bbd847bf8731fd5588a517
apropos comma sreedhar c2d172e0c8bbd847bf8731fd5588a517
apropos comma steensgard c2d172e0c8bbd847bf8731fd5588a517
apropos command_arg sreedhar 7ed3d61b122861a1fb56138903e92a08
apropos command_arg steensgard 7ed3d61b122861a1fb56138903e92a08
apropos command_args sreedhar b7b7ea492a1363c3952832612f255732
apropos command_args steensgard b7b7ea492a1363c3952832612f255732
apropos command_argstr havlak 264318c01a88625a7b07be5770cf28d0
apropos command_argstr sreedhar 264318c01a88625a7b07be5770cf28d0
areece-macbook-pro:ec2 areece$ comm -2 -3 <(for dir in $(ls havlak); do echo havlak/$dir/$dir.json; echo steensgard/$dir/$dir.json; echo sreedhar/$dir/$dir.json; done | sort) <(ls */*/*.json | sort)
havlak/aptitude-curses/aptitude-curses.json
havlak/ekiga/ekiga.json
havlak/inkscape/inkscape.json
havlak/inkview/inkview.json
havlak/sha384sum/sha384sum.json
havlak/sha512sum/sha512sum.json
havlak/traceroute.db/traceroute.db.json
havlak/traceroute6.db/traceroute6.db.json
sreedhar/aptitude-curses/aptitude-curses.json
$ cat print_buf.c
#include <stdio.h>
int main(int argc, char** argv, char** envp) {
char buf[100];
printf("Stack at %p\n", buf);
int i;
for (i = 0; envp[i]; i++) {
printf("%p: %s\n", envp[i], envp[i]);