How one can optimize the performance of existing Windows XP OS?

How one can optimize the performance of existing Windows XP OS? What are the options or hidden secrets that one should know to test complete capacity of OS? Why it is said that we normally cannot test RAM capability? What are the registries and how do they controlled to get your work from computer?