I did not observe any difference in performance due to this commit.
Here are the results I get:
272f327fbf bench: add peer eviction protection benchmarks
0| ns/op | op/s | err% | total | benchmark
1|--------------------:|--------------------:|--------:|----------:|:----------
2| 706,673,971.00 | 1.42 | 1.7% | 7.79 | `EvictionProtection1Network250Candidates`
3| 1,299,063,388.00 | 0.77 | 0.7% | 14.30 | `EvictionProtection3Networks050Candidates`
4| 1,155,171,747.00 | 0.87 | 0.5% | 12.73 | `EvictionProtection3Networks100Candidates`
5| 2,900,919,398.00 | 0.34 | 1.3% | 31.93 | `EvictionProtection3Networks250Candidates`
6
7| ns/op | op/s | err% | total | benchmark
8|--------------------:|--------------------:|--------:|----------:|:----------
9| 714,684,192.00 | 1.40 | 1.0% | 7.91 | `EvictionProtection1Network250Candidates`
10| 1,296,579,234.00 | 0.77 | 0.5% | 14.22 | `EvictionProtection3Networks050Candidates`
11| 1,159,393,440.00 | 0.86 | 0.7% | 12.71 | `EvictionProtection3Networks100Candidates`
12| 2,854,527,930.00 | 0.35 | 0.7% | 31.44 | `EvictionProtection3Networks250Candidates`
99a25fb393 p2p: iterate over eviction candidates once instead of thrice
0| ns/op | op/s | err% | total | benchmark
1|--------------------:|--------------------:|--------:|----------:|:----------
2| 709,622,212.00 | 1.41 | 1.0% | 7.79 | `EvictionProtection1Network250Candidates`
3| 1,310,376,054.00 | 0.76 | 1.2% | 14.39 | `EvictionProtection3Networks050Candidates`
4| 1,160,800,660.00 | 0.86 | 0.4% | 12.72 | `EvictionProtection3Networks100Candidates`
5| 2,983,258,845.00 | 0.34 | 0.5% | 32.71 | `EvictionProtection3Networks250Candidates`
6
7| ns/op | op/s | err% | total | benchmark
8|--------------------:|--------------------:|--------:|----------:|:----------
9| 711,091,374.00 | 1.41 | 0.5% | 7.82 | `EvictionProtection1Network250Candidates`
10| 1,318,781,548.00 | 0.76 | 0.3% | 14.38 | `EvictionProtection3Networks050Candidates`
11| 1,142,837,118.00 | 0.88 | 0.2% | 12.40 | `EvictionProtection3Networks100Candidates`
12| 2,943,154,182.00 | 0.34 | 0.4% | 32.22 | `EvictionProtection3Networks250Candidates`