MCPcopy Create free account
hub / github.com/astercloud/aster / BenchmarkActorRequest

Function BenchmarkActorRequest

examples/actor/actor_test.go:252–262  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

250}
251
252func BenchmarkActorRequest(b *testing.B) {
253 system := actor.NewSystem("bench")
254 defer system.Shutdown()
255
256 echo := &EchoActor{name: "echo"}
257 pid := system.Spawn(echo, "echo")
258
259 for i := 0; b.Loop(); i++ {
260 _, _ = pid.Request(&PingMsg{Count: i}, time.Second)
261 }
262}
263
264func BenchmarkActorConcurrent(b *testing.B) {
265 system := actor.NewSystem("bench")

Callers

nothing calls this directly

Calls 4

ShutdownMethod · 0.95
SpawnMethod · 0.95
NewSystemFunction · 0.92
RequestMethod · 0.45

Tested by

no test coverage detected