Getting high ping when MacBook Air is connected to Wi-Fi
I was frustrated with a symptom which was : 


High and spiking ping between 1ms to 9000ms 
full bar signal but 50%++ loss ping packet
RSSI &lt; -70db with 5-7 m distance from wifi router
Conflicting country code
Safari loading time takes forever, slow loading website (maybe due to loss packet)


What I have done was : 


Restarting, reconfigure network setting, reconfigure router, diagnose network, deleting lot of plist ---> the symptom still there. 
resolving COUNTRY CODE CONFLICT --- I was thinking that those symptom occur because CC conflict, thus I was editing the country code to be X2 by changing airportbrcm4331 (my case MacBook Air 2011) --> success but the ping still high. lot of article discuss how to do it. 
So I think that there was a something wrong with antenna not the modem because there are no indication of wifi failure. so I did a DIY open MBA, check the modem, and find out that the antenna connector loose and not plugged  properly. plug it... put back things...


and voila everything works like charm. low ping, fast Safari response and works like it suppose to be :D