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
#define _CRT_SECURE_NO_DEPRECATE | |
#include <stdio.h> | |
#include <string.h> | |
#include <Windows.h> | |
// This allocates a "magic ring buffer" that is mapped twice, with the two | |
// copies being contiguous in (virtual) memory. The advantage of this is | |
// that this allows any function that expects data to be contiguous in | |
// memory to read from (or write to) such a buffer. It also means that |
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
#!/bin/bash | |
# From http://tech.serbinn.net/2010/shell-script-to-create-ramdisk-on-mac-os-x/ | |
# | |
ARGS=2 | |
E_BADARGS=99 | |
if [ $# -ne $ARGS ] # correct number of arguments to the script; | |
then |
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
Use a ramdisk on OS X to speed up local dev cluster | |
Download ramdisk.sh: | |
https://gist.github.com/nickva/74f12b6163e578c3afb0649370f59dc5 | |
$ chmod a+x ./ramdisk.sh | |
$ ./ramdisk.sh create 4000 # create a 4GB disk mounted to /Volumes/ramdisk | |
Create ramdisk... |
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 escript | |
%% -*- erlang -*- | |
% | |
% File writer benchmarking tool | |
% | |
% chmod a+x make sure escript is there, then run as: | |
% $ ./dderl block_count block_size fsync|nofsync | |
% | |
% Example: | |
% $ ./dderl 10000 4096 fsync |
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
-module(bench). | |
-compile(export_all). | |
%% Luke Gorrie's favourite profiling macro. | |
-define(TIME(Tag, Expr), | |
(fun() -> | |
%% NOTE: timer:tc/4 does an annoying 'catch' so we | |
%% need to wrap the result in 'ok' to be able to | |
%% detect an unhandled exception. | |
{__TIME, __RESULT} = |
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 python | |
import sys, couchdb | |
DBURL='http://adm:pass@localhost:15984' | |
V = 'v'*1 | |
def add_view(db): | |
db['_design/d1'] = { | |
"views": { |
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 python | |
import sys, socket, hashlib | |
import couchdb | |
import base64 | |
def setup_db(dbname, user, password, port): | |
url = 'http://%s:%[email protected]:%d'% (user, password, port) | |
print "url:", url |
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 python | |
import argparse | |
import sys | |
import requests | |
import couchdb | |
import random | |
import string | |
import uuid | |
import time |
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 python | |
import argparse | |
import sys | |
import couchdb | |
import random | |
import string | |
import uuid | |
import time | |
import copy |
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 python | |
import argparse | |
import sys | |
import couchdb | |
import random | |
import string | |
import uuid | |
import time | |
import copy |
OlderNewer