This issue has been driving me crazy for some time. Every 10 seconds or so, performance on my machine would suffer dramatically. It was not a CPU issue, and I couldn't see anything related to a process eating a bunch of I/O. Finally, I used ping to just watch what was going on between my MacBook Pro and the wireless gateway. Every 10 seconds, 1-3 ping packets would be lost, and then the next several packets would be delayed by 300-900ms. And every few minutes, I would have packet loss for 30 seconds or more.
In Console, I kept getting the "com.apple.message.domain: com.apple.wifi.internal.scanning No Error" message, and it coincides with the ping packet loss.
Next thing I tried was to HUP the WiFiAgent.
ps auxww | grep -i wifiagent
found the corresponding process...
kill -HUP {pid}
And now it is working just fine... back to ~2.5ms response times and no packet loss at all. And, all of the "No Error" messages in the Console stopped occurring.
Something clearly set it on this bad path, and I would like to figure out what that is. But for now, it appears to be better.
The machine impacted is a MacBook Pro (15-inch, 2016) running Sierra 10.12.4.
Hope that this helps you as well.