============================================================================= 基准测试 =============================================================================
(b *testing.B)
| 238 | // ============================================================================= |
| 239 | |
| 240 | func BenchmarkActorTell(b *testing.B) { |
| 241 | system := actor.NewSystem("bench") |
| 242 | defer system.Shutdown() |
| 243 | |
| 244 | counter := &CounterActor{name: "counter"} |
| 245 | pid := system.Spawn(counter, "counter") |
| 246 | |
| 247 | for b.Loop() { |
| 248 | pid.Tell(&IncrementMsg{Value: 1}) |
| 249 | } |
| 250 | } |
| 251 | |
| 252 | func BenchmarkActorRequest(b *testing.B) { |
| 253 | system := actor.NewSystem("bench") |