Commit a9a3c3f
committed
fix: optimize WantConnQueue benchmarks to prevent memory exhaustion
- Fix BenchmarkWantConnQueue_Dequeue timeout issue by limiting pre-population
- Use object pooling in BenchmarkWantConnQueue_Enqueue to reduce allocations
- Optimize BenchmarkWantConnQueue_EnqueueDequeue with reusable wantConn pool
- Prevent GitHub Actions benchmark failures due to excessive memory usage
Before: BenchmarkWantConnQueue_Dequeue ran for 11+ minutes and was killed
After: All benchmarks complete in ~8 seconds with consistent performance1 parent 56eb8df commit a9a3c3f
1 file changed
+43
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
369 | 380 | | |
370 | 381 | | |
371 | 382 | | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
| 383 | + | |
376 | 384 | | |
377 | 385 | | |
378 | 386 | | |
379 | 387 | | |
380 | 388 | | |
381 | 389 | | |
382 | 390 | | |
383 | | - | |
384 | | - | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
385 | 396 | | |
386 | 397 | | |
387 | 398 | | |
| |||
390 | 401 | | |
391 | 402 | | |
392 | 403 | | |
| 404 | + | |
| 405 | + | |
393 | 406 | | |
394 | | - | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
395 | 419 | | |
396 | 420 | | |
397 | 421 | | |
398 | 422 | | |
399 | 423 | | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
404 | 430 | | |
405 | 431 | | |
406 | 432 | | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
407 | 439 | | |
408 | 440 | | |
409 | 441 | | |
| |||
0 commit comments