YMMV - I was in college for six years, got a BS and MS in CS.
I was surrounded by people who, like you said, regularly stayed up all night prior to exams. Sometimes we even scheduled that: the students would organize study-group sessions from 10PM-til.
I had a policy then that, no matter what, I was going to get a full night's sleep. Period. Full stop. I think it served me very well. A quick refresher in the morning gave me probably as much recency in terms of memory, and personally, my brain just works a lot, lot better with plenty of sleep. Even if I didn't know an answer, it was a lot easier to stay calm and rationalize something that often turned out to be right or good enough.
I only felt a little bad about it once - in a math class I left the study group right before my bedtime, while still getting the notes they'd put together the rest of the night. I felt a little uneasy about not pulling my weight, so to speak, but oh well. It could have been scheduled earlier and I would have gladly stayed.
So I'd keep it up.
Nowadays things are a little different for me - a lot of my job unfortunately involves being present regardless of whether there's anything to actually do. I worked two-and-a-half days straight a couple months ago. No overtime pay. :\