Skip to content

Instantly share code, notes, and snippets.

(ns jepsen.ydb.serializable
(:require [elle.core :as elle]
[elle.list-append :as a]
[jepsen.history :as h]
[jepsen.checker :as checker]
[jepsen.tests.cycle.append :as append]
[bifurcan-clj [core :as b]]
[elle.graph :as g]
[elle.rels :as rels :refer [ww wr rw process realtime]]
[dom-top.core :refer [loopr]])
#!/usr/bin/python3
import sys
import asyncio
import greenlet
class AsyncIoGreenlet(greenlet.greenlet):
def __init__(self, driver, fn):
greenlet.greenlet.__init__(self, fn, driver)
self.driver = driver
@snaury
snaury / Program.cs
Created May 18, 2017 21:12
Trying to measure coreclr gc pauses under extreme pressure
using System;
using System.Threading;
using System.Diagnostics;
using System.Collections.Generic;
namespace hello_memory
{
class MyObject
{
public int value;
@snaury
snaury / benchmark.txt
Created March 7, 2017 21:18
Sub-millisecond GC pauses... if you don't allocate
$ time GODEBUG=gctrace=1 ./go-mem-stress
gc 1 @0.003s 2%: 0.045+5.7+0.032 ms clock, 0.13+0/0.68/5.2+0.098 ms cpu, 4->4->0 MB, 5 MB goal, 4 P
gc 2 @0.010s 2%: 0.009+11+0.041 ms clock, 0.036+0/0.75/10+0.16 ms cpu, 5->5->1 MB, 6 MB goal, 4 P
gc 3 @0.022s 3%: 0.004+12+0.031 ms clock, 0.018+0.021/3.0/9.6+0.12 ms cpu, 4->4->2 MB, 5 MB goal, 4 P
gc 4 @0.035s 4%: 0.010+19+0.060 ms clock, 0.041+0/3.8/16+0.24 ms cpu, 5->5->2 MB, 6 MB goal, 4 P
gc 5 @0.056s 3%: 0.005+16+0.023 ms clock, 0.020+0/1.3/15+0.092 ms cpu, 6->6->3 MB, 7 MB goal, 4 P
gc 6 @0.075s 3%: 0.007+19+0.042 ms clock, 0.029+0/3.0/16+0.16 ms cpu, 8->8->4 MB, 9 MB goal, 4 P
gc 7 @0.095s 5%: 2.6+25+0.025 ms clock, 10+0.094/3.2/0.043+0.10 ms cpu, 10->10->10 MB, 11 MB goal, 4 P
gc 8 @0.127s 4%: 0.009+45+0.046 ms clock, 0.037+0/5.1/40+0.18 ms cpu, 16->17->6 MB, 20 MB goal, 4 P
gc 9 @0.175s 4%: 0.008+41+0.071 ms clock, 0.032+0/2.9/38+0.28 ms cpu, 15->15->8 MB, 16 MB goal, 4 P
#include <greenlet/greenlet.h>
@snaury
snaury / results.txt
Last active October 8, 2015 06:38
Scheduling latencies with gevent/greenlet
Total time: 1.027ms
Latencies: 0.228ms-0.390ms
First-last send: 0.308ms
First-last recv: 0.050ms
First-last return: 0.146ms
@snaury
snaury / cpuinfo.txt
Created October 5, 2015 22:27
Scaleway linux
$ cat /proc/cpuinfo
Processor : Marvell PJ4Bv7 Processor rev 2 (v7l)
processor : 0
BogoMIPS : 1332.01
processor : 1
BogoMIPS : 1332.01
processor : 2
BogoMIPS : 1332.01
import os
import shutil
from bsddb.db import *
DB_HOME = 'data'
DB_FILENAME = 'queue.db'
if os.path.isdir(DB_HOME):
shutil.rmtree(DB_HOME)
os.makedirs(DB_HOME)
@snaury
snaury / configure-intel-rapid-start.conf
Created April 11, 2014 21:04
Upstart job for configuring Intel Rapid Start to save memory to disk only when battery is critically low
description "Configure Intel Rapid Start"
start on acpi-device-added DEVPATH=*/INT3392:00
task
script
test -f "/sys$DEVPATH/wakeup_events" || { stop; exit 0; }
echo -n 2 >"/sys$DEVPATH/wakeup_events"
end script
#!/usr/bin/python
# -*- encoding: utf-8 -*-
from __future__ import print_function
import time
import threading
import multiprocessing
from Queue import Queue
from multiprocessing import Queue as MPQueue
messages = (