3 ms·
Mh, if I understand correctly the messaging system being tested is https://github.com/derekcollison/nats https://github.com/derekcollison/nats and it is not wri
by paulasmuth 14y ago
Mh, if I understand correctly the messaging system being tested is https://github.com/derekcollison/nats https://github.com/derekcollison/nats and it is not written in Go but in Ruby (+EventMachine). Or is there a Go version of NATS?
Also, this is only testing the time it takes the go client to write the messages to the socket, not the time the server takes to process the messages. So the benchmark would be the same with a noop server that reads and discards all incoming traffic. Am I wrong?
- timtadh 14y agoI am not the author of the gist but quoting from it: "our work on a high performance NATS server in Go." Furthermore, the tests he shows are run using Go's testing tool (which tests go code). Finally, he discusses "no use of defer" a Go language feature not in Ruby. So yes I believe it is an implementation in Go.
- randomdata 14y agoI agree with your analysis, but EventMachine does use a defer method to push long-running work off of the event loop.
- 4ad 14y agoDefer in Go means something very specific and completely different: http://golang.org/ref/spec#Defer_statements http://golang.org/ref/spec#Defer_statements http://golang.org/doc/effective_go.html#defer http://golang.org/doc/effective_go.html#defer
- randomdata 14y agoBut EventMachine#defer would make sense in this context, given that the Ruby version is written with EventMachine. That is why I noted it.
- dbaupp 14y agoFor your first question: maybe, there is "s = startServer(b, PERF_PORT, "")" in the code, but this could easily be an external call.
- malingo 14y agoThe benchmark command has the path "~/gnatsd" in the prompt. Looks like it's Go-NATS.
- derekcollison 14y agoThe test is specific to a new NATS server written in GO (gnatsd). I described in more detail above the tests and what they do, but suffice it to say that it does test the message processing overhead of the server.