Hey, you made some mistakes. You knew enough to know they were wrong and fix them (or attempt to fix them). I was kind of going along with you like, "ah man, yeah, sucks." Everyone gets frustrated, call that mental sweat.
I am in a daily competition with my peers at a very competitive university in the bay area. Stats are posted after every exam and most homeworks--so you see exactly how you compare to everyone else. It can get distracting if there's no perspective.
As far as your colleagues go, I'd bet some non-trivial percentage of the perceived skill gap is illusory. It's easy to think someone else is smarter/faster; it's even easier to let others think that you're the one that's smarter/faster.
https://youtu.be/RU_GBcdxT84
For me, the best way to level the field is to ask questions. I often find people don't know as much as they let on (unhelpful). Or the person does know a lot, (helpful) then I'm picking their brain. I like to think of this as sharpening against others instead of competing.
What I do to maintain optimal performance/memory/recall:
Prioritize sleep. I shifted my day to the left. I wake up at 5 and I use my "best brain hours" on priorities. I am a night owl, but giving that up seems to have helped my memory/study habits.
I practiced these two things without knowing: spaced-repetition and active recall. Learning about them prompted me to begin a more structured approach.
If there's something I need to learn well, I want to pile as many sleep intervals on top of it as possible. I don't know if there's science for this, but I feel as though more sleep on a topic helps me consolidate the memory.
Slow is often fast, but fast is helpful too. If you're going to make a fast pass over material, then let it be just that--a fast pass. Then make a slow pass. Try not to build up "pressure."
Sometimes anxiety can set in and it is a drain. I also think it may even distort the perception of time. So, you may not even be spending as much time trying to grok something as you might think. Set a timer, and do twenty (or whatever) minute intervals. My goal is to always work until I surprise myself.
A hurt ego favors downtime and often wastes time. Have a plan in place for when you do get frustrated. When you're rolling up on gridlock, have a couple little side streets you can detour on. That is, maybe try to have some related topic to work on that's in a similar domain. This way, you're still moving forward; getting another win can boost confidence and might give you some inspiration.
Yeah, like I said in the beginning I had expected it to read something like, "...and I can't get a job..." I am in classes with students who think being in the mean or below it means they'll _never_ get a job. I know we're likely at very different places career wise, but damn I'd like to be the slowest coder at a firm ha, you know? Been working my ass off to become a good engineer and contribute.
Another thing that helps me is maintaining a beginners mindset; I try to not be offended by something I don't know or have forgotten. It's hard, but not carrying that weight means I can focus better.