Some rudimentary protocol benchmarks for go.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

28 lines
414 B

package bson
import (
"labix.org/v2/mgo/bson"
)
type BsonTest struct {
Version float32
Method string
Params []string
}
func BsonPack() {
bson.Marshal(&BsonTest{
Version: 2.0,
Method: "echo",
Params: []string{
"some",
"params",
"here",
},
})
}
func BsonUnpack() {
var test BsonTest
bson.Unmarshal([]byte(`{"Version":2.0,"Method":"echo","params":["some","params","here"]}`), &test)
}