I am a third year undergrad in computer science, at a US university. Even before I was an undergrad, I was considering pursuing a PhD in theory after graduation; until the research internship I did this summer (for CS people, it was in quantum comp. complexity). I really enjoy the courses I take, and like thinking about/working on CS theory outside school, too. I also enjoyed idea of doing research as a full time job.
However, after some weeks into the internship, I started to have a quite hard time reading the papers on the topic I was working on; they started to feel like they were just too hard for me to understand. It was taking too long to grasp the idea of even a couple of pages. I had to study late after work for quite some time. But, I don't think that's the real problem. The real problem is that, I did not enjoy the struggle, I felt miserable, tired and stressed. Although I kept pushing and working on it for some more time, after a point, I just lost the energy to continue and just procrastinated for a couple of weeks. And at the end of the internship, I had no result. I feel like I could only learn a little about the topic and the current work on it, let alone coming up with an idea of mine or contributing anything. At the meetings with my advisor, I could only talk a little bit about what I read, I did not have any new ideas; most of the time I was just listening to his ideas. I think that maybe the only reasons I wanted a PhD was that I was doing good in courses or to prove that I am smart to enough to be a researcher. These feelings and loss of energy made me really scared of the ~5 years commitment to a PhD, or maybe the life-long commitment to a career in research. I keep thinking that same could happen during the PhD and I would have wasted many (could-be-)productive years.
On the other hand, I don't think I want to work as an engineer, just coding everyday and developing some apps, following some "best practices" without thinking, using my brain much; although it feels a lot easier to do so (and maybe leads to a more enjoyable life, since I would be actually free after work hours). I feel like that would be underutilizing my capacity.
I know that someone cannot decide for me, or know what I really want. But my question is that, how can I decide which way should I choose? What should I ask myself? What should I try (for example, maybe doing a masters first)?