I recently installed Ubuntu as well and faced the same problem. My wi-fi was quite fast at first, then it was pretty much dead. I tried the following solutions and they fixed the problem on my Lenovo laptop.
For Slow WiFi in Atheros Wireless Network Adaptors:
sudo -s
echo "options ath9k nohwcrypt=1" >> /etc/modprobe.d/ath9k.conf
Disable 802.11n
sudo rmmod iwlwifi
sudo modprobe iwlwifi 11n_disable=1
If this doesn't work for you, forget about it, otherwise make it permanent:
sudo su
echo "options iwlwifi 11n_disable=1" >> /etc/modprobe.d/iwlwifi.conf
sudo service networking restart
(or reboot)
Disable IPv6 support
sudo su
echo "#disable ipv6" >> /etc/sysctl.conf
echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf
echo "net.ipv6.conf.default.disable_ipv6 = 1" >> /etc/sysctl.conf
echo "net.ipv6.conf.lo.disable_ipv6 = 1" >> /etc/sysctl.conf
sudo service networking restart
(or reboot)
Ditch default network manager and embrace wicd
sudo apt-get install wicd
Source
Also, there is already a similar question asked by another HP user. Check this solution as well.
http://ubuntuforums.org/showthread.php?t=2175345