I had the same problem. Recent (Jan 2013) installation of XAMPP but same code base as both production server and another development machine. It took 2+ seconds each time PHP connected to MySQL, and in some transactions there were several connections. I tried skip-name-resolve in the my.ini file, this failed completely. I then made a one character change to the hosts file and all worked. Go to c:/windows/system32/drivers/etc. Edit hosts. Remove the # comment character from the local host line (or perhaps add it as below)
# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
Stopped and restarted MySQL service. This was a complete fix.