For a while I had terrible (in the 800msec - 4000msec range) RTT pinging an AP right next to me, running:
sudo iw dev wlan0 set power_save off
did the trick for me (issued after every boot or through an UDev rule such as
https://raw.github.com/lvillani/ansible-playbooks/9dc40c75cf...)