Skip to content

Instantly share code, notes, and snippets.

@badboy
badboy / redis-benchmark-P100.txt
Created June 6, 2014 20:00
Redis benchmark results on Intel Xeon Phi (redis compiled with: `MALLOC=libc CC="icc -mmic" make`)
$ src/redis-benchmark -P 100
PING_INLINE: 0.00
====== PING_INLINE ======
10000 requests completed in 0.10 seconds
50 parallel clients
3 bytes payload
keep alive: 1
0.01% <= 5 milliseconds
2.01% <= 10 milliseconds
@badboy
badboy / gist:c7ca4f0f376b727af1f0
Created August 14, 2014 12:38
redis logo in ascii
[12764] 14 Aug 14:38:18.245 # Current maximum open files is 4096. maxclients has been reduced to 4064 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 2.8.13 (9fa51dd4/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in stand alone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 12764
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
@badboy
badboy / es6-arrows.sjs
Last active August 29, 2015 14:05 — forked from btd/es6-arrows.sjs
// sweet.js arrow function macro
// https://github.com/mozilla/sweet.js/
macro => {
rule infix { ( $arg:ident (,) ... ) | { $body ... $last:expr } } => {
(function ( $arg (,) ... ) {
$( $body) ...
return $last
}).bind(this)
}
diff --git i/include/horizontime.h w/include/horizontime.h
index b3ccf89..2db2083 100644
--- i/include/horizontime.h
+++ w/include/horizontime.h
@@ -50,7 +50,7 @@ struct horizontime_t
parentExecutionOrderId < other.parentExecutionOrderId ? false :
schedulingOrderId > other.schedulingOrderId ? true : // 5. criterion: scheduling order
schedulingOrderId < other.schedulingOrderId ? false :
- insertOrder > insertOrder; // 6. criterion: final tie breaker (needed during init)
+ insertOrder > other.insertOrder; // 6. criterion: final tie breaker (needed during init)
# Contributor: Anonymous
# Generator : CPANPLUS::Dist::Arch 1.28
pkgname='perl-exporter-tiny'
pkgver='0.042'
pkgrel='1'
pkgdesc="an exporter with the features of Sub::Exporter but only core dependencies"
arch=('any')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
# Contributor: Anonymous
# Generator : CPANPLUS::Dist::Arch 1.28
pkgname='perl-type-tiny'
pkgver='1.000004'
pkgrel='1'
pkgdesc="tiny, yet Moo(se)-compatible type constraint"
arch=('any')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
@badboy
badboy / murmurhash.rs
Created October 28, 2014 13:26
Port of the MurmurHash64A function from Redis.
// Port of the MurmurHash64A function from Redis.
// Original here: https://github.com/antirez/redis/blob/93eed9ae0163e328c33b16ab9ea3c4fbe0f98674/src/hyperloglog.c#L390-L439
extern crate test;
use std::os;
use test::Bencher;
fn murmur_hash64a(key: &[u8], seed: u64) -> u64 {
let m : u64 = 0xc6a4a7935bd1e995;
let r : uint = 47;
@badboy
badboy / start.rb
Last active August 29, 2015 14:08
#! /usr/bin/env ruby
require 'fileutils'
$pids = []
$first_child = true
def kill_all
$pids.each do |pid|
begin
@badboy
badboy / gist:f28fc95b74471c7ba4a0
Created November 26, 2014 12:50
Compile siped on SmartOS
wget http://www.tarsnap.com/spiped/spiped-1.4.2.tgz
tar -xvf spiped-1.4.2.tgz
cd spiped-1.4.2
pkgin -y in gcc48 gmake
mkdir bin
gmake clean all install BINDIR=$(pwd)/bin CC=gcc CFLAGS_DEFAULT="-O2 -D__EXTENSIONS__"
> r = redis.createClient()
> r.del("foo")
true
> r.hmset("foo", { a: "b", c: "d", e: "f" })
true
> r.hgetall("foo", function(e,v) { console.log(v) })
true
> { a: 'b', c: 'd', e: 'f' }
undefined