============== 基准测试 ==============
(b *testing.B)
| 361 | // ============== 基准测试 ============== |
| 362 | |
| 363 | func BenchmarkSystem_Send(b *testing.B) { |
| 364 | system := NewSystem("bench") |
| 365 | defer system.Shutdown() |
| 366 | |
| 367 | counter := &CounterActor{} |
| 368 | pid := system.Spawn(counter, "counter") |
| 369 | |
| 370 | for b.Loop() { |
| 371 | system.Send(pid, &CountMsg{Value: 1}) |
| 372 | } |
| 373 | } |
| 374 | |
| 375 | func BenchmarkSystem_RequestResponse(b *testing.B) { |
| 376 | system := NewSystem("bench") |