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

Function BenchmarkActorConcurrent

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

Source from the content-addressed store, hash-verified

262}
263
264func BenchmarkActorConcurrent(b *testing.B) {
265 system := actor.NewSystem("bench")
266 defer system.Shutdown()
267
268 counter := &CounterActor{name: "counter"}
269 pid := system.Spawn(counter, "counter")
270
271 b.ResetTimer()
272 b.RunParallel(func(pb *testing.PB) {
273 for pb.Next() {
274 pid.Tell(&IncrementMsg{Value: 1})
275 }
276 })
277}
278
279// =============================================================================
280// 高级测试

Callers

nothing calls this directly

Calls 4

ShutdownMethod · 0.95
SpawnMethod · 0.95
NewSystemFunction · 0.92
TellMethod · 0.80

Tested by

no test coverage detected