A user agent is a string that identifies the client software that is trying to access the resources of a server. Consider the following agent:
Mozilla/5.0 (Linux; U; Android 2.2.1; en-us; Nexus One Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
This agent informs the server that it is a Nexus One device running Froyo and the locale is in English.
The user agent does not affect performance. It is used by servers to identify the client platform. If a server can identify the client platform correctly, it can send it appropriate resources depending on the client's capabilities. It can, for example deliver pages in a different language depending on where the client is located.