Skip to content

Instantly share code, notes, and snippets.

@trinitum
trinitum / atomic_test.go
Created June 15, 2017 13:13
Test different methods of synced access
package main
import (
"sync"
"sync/atomic"
"testing"
)
type Foo struct {
sync.RWMutex
@trinitum
trinitum / benchmrk_geo.pl
Last active August 29, 2015 14:26
Redis Geo API benchmark
#!/usr/bin/env perl
use 5.014;
use strict;
use warnings;
use Benchmark qw(timethis);
use Path::Tiny;
use RedisDB 2.46;
my $redis = RedisDB->new;
@trinitum
trinitum / zmq_pub_sub.pl
Created October 8, 2012 13:31
0MQ publish/subscribe
use 5.010;
use strict;
use warnings;
use ZMQ;
use ZMQ::Constants qw(ZMQ_PUB ZMQ_SUB ZMQ_SUBSCRIBE);
use Time::HiRes qw(usleep);
if (fork) {
$0 = "ZMQ Publisher";
use Benchmark qw(:all);
use Devel::Size;
use Storable;
sub _storable_freeze {
length Storable::freeze $_[0];
}
sub _storable_reopen {