I hereby claim:
- I am derekcollison on github.
- I am derekcollison (https://keybase.io/derekcollison) on keybase.
- I have a public key whose fingerprint is 123C 60DB 9DCE 9CB1 B2E8 CA5D 677A 5159 1919 3B29
To claim this, I am signing this object:
#!/usr/bin/env node | |
/* jslint node: true */ | |
'use strict'; | |
var nats = require ('../lib/nats.js').connect('nats://demo.nats.io:4222'); | |
var cuid = require('cuid'); | |
nats.on('error', function(e) { | |
console.log('Error [' + nats.options.url + ']: ' + e); |
package main | |
import ( | |
"crypto/rand" | |
"encoding/hex" | |
"fmt" | |
"io" | |
"log" | |
"runtime" |
ubuntu vm on MBA 11" 2013 | |
ubuntu@apcera-raring-amd64:~/go/src/github.com/apcera/gnatsd/test$ go test --run="zzz" --bench="." | |
PASS | |
Benchmark___PubNo_Payload 10000000 209 ns/op 52.59 MB/s | |
Benchmark___Pub8b_Payload 10000000 293 ns/op 95.40 MB/s | |
Benchmark__Pub32b_Payload 5000000 433 ns/op 175.36 MB/s | |
Benchmark_Pub256B_Payload 1000000 1942 ns/op 270.28 MB/s | |
Benchmark___Pub1K_Payload 200000 8971 ns/op 229.84 MB/s |
package main | |
import ( | |
"fmt" | |
"sort" | |
"sync" | |
"time" | |
"github.com/nats-io/go-nats" | |
) |
~/Development/go/src/github.com/nats-io/nats/examples> ./nats-bench -np 16 -n 100000 foo ok | |
Starting benchmark | |
msgs=16X100000, pubs=16, subs=0 | |
################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################# |
I hereby claim:
To claim this, I am signing this object:
// All subscriptions with the same queue name will form a queue | |
// group at runtime. Each message will be delivered to only one | |
// subscriber per queue group. You can have as many queue groups | |
// as you wish, and as many members in a single group as you like. | |
// Normal subscribers will continue to work as expected. | |
nc.QueueSubscribe("foo", "job_workers", func(m *Msg) { | |
// Do some work, then send reply. | |
nc.Publish(m.ReplyTo, myAnswer) | |
}) |
package main | |
import ( | |
"log" | |
"os" | |
"os/signal" | |
"runtime" | |
"syscall" | |
"github.com/nats-io/go-nats" |
// Copyright 2012-2018 The NATS Authors | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, | |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
I have really come to enjoy working in Go. From time to time I expect that the team at Apcera will | |
need to dip back into C for some things, but I decided to try to push the envelope with Go on making | |
some faster HashMaps than Go's builtin map. I started with the hash algorithms. | |
These are some results from my MBA11" core i7.. The fastest Hash algorithms will not work on machines | |
without support for unaligned access, and I still need to do some cleaning up before we OSS, but so far so good. | |
I aslo need to implement the fastest one, FNV1A_Hash_Yorikke, from http://http://www.sanmayce.com/Fastest_Hash | |
I hack SetBytes(1) to get a rough idea of ops/sec, its not actually IO.. So 10 MB/s is 10 Million ops per sec. |