First off, your school is incredibly tough and so kudos to you. I have no doubt it is a ton of pressure no matter what.
Note: I am not a doctor. I'm not even a Boston Terrier in a pink bunny suit.
Second, performance issues do not = being gay or really any specific sexuality.
Next, that gal does not sound too terribly nice, so no wonder you were not having the easiest time with her. This is not to say that things will be easier with every other woman on the planet, but it might just be her. Plus you said you weren't connecting, which can also give one anxieties. Maybe that's the issue, that you're with women who you don't connect with. There are plenty of folks who are like this (and there is nothing wrong with it); it's generally looked at as a subset of asexuality. As in, folks who only get their boat floated (er, you know what I mean) by a specific person. And in your case, when it comes to you, you might really have a specific person, but she ain't it.
On the other hand, maybe you are gay or bi, and both are perfectly fine things to be. All of this is utterly valid, but understand that you might not be completely settled at this stage of your life. And that is cool. If you want to come out to your friends and family, then do so. And if you don't want to, or you're unsure, that's good, too. Personally, I think everyone should come out with their sexuality, no matter what it is and take the onus off folks of one stripe or another.
Hence I will now come out as hetero, a fact which I presume makes my husband (I am a dudette) happy.
But I digress.
No matter what the real deal is for you, not sleeping is horrible and it is a big threat to your health. The US armed forces, and the armed services of many nations, offers comprehensive counseling for pretty much anyone who needs it. It's confidential of course, because you have a physician-patient privilege as well as a therapist-patient privilege.
So, my suggestion is, talk to the base doctor. Even if you don't want to talk about wedding tackle and where you would like to place yours, I suggest you talk about your insomnia as a starting point, and your stress. Because that sucks and it's bad for your health and of course you also want to pass and graduate.
Finally, no matter what you decide, and what you feel you are, that is the right decision. What you are
is what is right, C.