Open mrd0ll4r opened 8 years ago
Removing defer
s whenever convenient:
benchmark old ns/op new ns/op delta
BenchmarkPeerStore_PutSeeder-8 782 581 -25.70%
BenchmarkPeerStore_PutSeeder1KInfohash-8 777 589 -24.20%
BenchmarkPeerStore_PutSeeder1KSeeders-8 1033 749 -27.49%
BenchmarkPeerStore_PutSeeder1KInfohash1KSeeders-8 786 592 -24.68%
BenchmarkPeerStore_PutDeleteSeeder-8 3109 2982 -4.08%
BenchmarkPeerStore_PutDeleteSeeder1KInfohash-8 3609 3110 -13.83%
BenchmarkPeerStore_PutDeleteSeeder1KSeeders-8 3875 2909 -24.93%
BenchmarkPeerStore_PutDeleteSeeder1KInfohash1KSeeders-8 3616 3498 -3.26%
BenchmarkPeerStore_DeleteSeederNonExist-8 808 534 -33.91%
BenchmarkPeerStore_DeleteSeederNonExist1KInfohash-8 728 578 -20.60%
BenchmarkPeerStore_DeleteSeederNonExist1KSeeders-8 804 558 -30.60%
BenchmarkPeerStore_DeleteSeederNonExist1KInfohash1KSeeders-8 772 555 -28.11%
BenchmarkPeerStore_PutGraduateDeleteLeecher-8 4670 3657 -21.69%
BenchmarkPeerStore_PutGraduateDeleteLeecher1KInfohash-8 4009 3725 -7.08%
BenchmarkPeerStore_PutGraduateDeleteLeecher1KSeeders-8 4732 3960 -16.31%
BenchmarkPeerStore_PutGraduateDeleteLeecher1KInfohash1KSeeders-8 4628 3755 -18.86%
BenchmarkPeerStore_GraduateLeecherNonExist-8 728 574 -21.15%
BenchmarkPeerStore_GraduateLeecherNonExist1KInfohash-8 1028 642 -37.55%
BenchmarkPeerStore_GraduateLeecherNonExist1KSeeders-8 1019 707 -30.62%
BenchmarkPeerStore_GraduateLeecherNonExist1KInfohash1KSeeders-8 780 722 -7.44%
BenchmarkPeerStore_AnnouncePeers-8 21583 23605 +9.37%
BenchmarkPeerStore_AnnouncePeers1KInfohash-8 25818 25975 +0.61%
BenchmarkPeerStore_AnnouncePeersSeeder-8 24462 23501 -3.93%
BenchmarkPeerStore_AnnouncePeersSeeder1KInfohash-8 24761 22537 -8.98%
BenchmarkPeerStore_GetSeeders-8 189936 178787 -5.87%
BenchmarkPeerStore_GetSeeders1KInfohash-8 171768 168757 -1.75%
BenchmarkPeerStore_NumSeeders-8 359 102 -71.59%
BenchmarkPeerStore_NumSeeders1KInfohash-8 387 108 -72.09%
Do these to improve performance:
sync.Pool
s for slices/arrays?chihaya.Infohash
to avoid allocations?