The hard drive on both is extremely slow at 4200 rpms.
If you can upgrade that, it would help a lot for your system's response. Otherwise, both of them are decent. The compaq looks like it has a newer processor so I'd lean more towards the compaq.
Honestly, why not build yourself one off of hp's configurator? I did that with my laptop. I know there is the dv5z which has an amd cpu in it and is much cheaper than the intel dv5t that I have. It would be around the same price as the compaq and hp you are looking at with a bit better performance.