I didn't understand why firefox suddenly is very slow while
programming and running on localhost. I've found this article
"Fixing Firefox Slowness with localhost on Vista (or XP with
IPv6)"
I'm using Windows 7 and not Vista or XP but the solution
worked.
To make the change, type about:config in the
address bar, locate the network.dns.disableIPv6 setting
and double-click on it to set it to true.
See this URL from Dan Wahlin:
fixing-firefox-slowness-with-localhost-on-vista