Here is my mentor's (@https://github.com/MariusVanDerWijden) implementation based on the version I pushed before.
https://github.com/ethereum/go-ethereum/compare/master...MariusVanDerWijden:txpool-attacks?expand=1
The previous attack defenses are being tested on the real network and the refactor and benchmarking results are not significantly worse than the current version:
name old time/op new time/op delta
ListAdd-24 83.5ms ± 2% 128.5ms ± 0% ~ (p=0.333 n=2+2)
PendingDemotion100-24 85.8ns ± 0% 84.9ns ± 1% ~ (p=0.667 n=2+2)
PendingDemotion1000-24 82.2ns ± 2% 84.1ns ± 2% ~ (p=0.667 n=2+2)