There is a good chance that Norman Triplett is the most famous psychologist you have never heard of. While you know the names of Freud, Maslow and Jung, it is likely that you have never heard of Triplett, who conducted his research at the end of the 1800s and the beginning of the 1900s.
In particular, Triplett's 1898 study of the speed of bicyclists is thought to be both the first published study in social psychology and also the advent of the field of sports psychology. Triplett, himself an avid cyclist, was interested in factors related to the performance of racers. What he discovered was that when people raced alone their speed was, on average, 2 minutes and 29 seconds per mile. When they raced together, however, their performance increased dramatically to 1 minute and 53 seconds per mile. Triplett concluded that the presence of other people activated a competitive drive and activates physiological energy that is otherwise difficult to access.
To be fair, you should know that a psychologist named Frere conducted a study in 1887 in which he was curious about the performance effects of bystanders. Frere used a "dynamometer" to measure the force of a person's grip. When another person engaged in the exact same activity nearby the first person's grip doubled in force.
You already are the beneficiary of these findings, which have come to be called "social facilitation." You know, for instance, that it is easier to maintain a diet when you do it with a friend, that you are less likely to quit in the middle of a workout if you are part of a class setting, that your public speaking is better in front of a live audience than when practicing alone in a hotel room, and that you play at a higher level when games involve intense competition.
It is especially interesting to consider the role of social facilitation not in the context of competition but, rather, in situations that involve sustained attention. Doctoral research by Lyra Stein examined the role that social interactions play when people tried to focus on a difficult word-pairing task. Introverts, as it turns out, could be easily overstimulated by others and their performance declined. Extroverts, by contrast, showed a gain in performance with the additional stimulation of another person.
In the end, it may not be that the presence of others is fundamentally good for performance. It is likely, instead, that context and personality variables matter. In thinking about your own performance it might be helpful to consider your own leanings toward introversion or extroversion as well as your own comfort with competition so that you can maximize the potential benefits of social facilitation.