What sleep is doing
During sleep, newly formed memories are replayed and reorganised — moved from fragile, short-term storage into more durable form, and integrated with what you already knew. This is consolidation, and it does not happen while you are awake reading more.
So the material you studied today is not really yours until you've slept on it. Take the sleep away and you have done the work of encoding without doing the work of keeping.
The all-nighter is a very bad trade
- You don't consolidate what you crammed. Most of it is gone within days.
- You impair the next day's encoding too. A sleep-deprived brain is measurably worse at forming *new* memories, so the deficit follows you into the exam.
- Attention, working memory and error rates all degrade — precisely the faculties an exam is testing.
- You feel more prepared and perform worse, which is the most dangerous combination available, because it removes the signal that would have stopped you.
Sleep is also when the connections get made
The commonplace that you "solve the problem in the shower" is close to a real phenomenon: consolidation involves reorganisation, not just storage, and insight is often what reorganisation feels like from the inside. Which means the night's sleep after a hard problem is doing something the extra hour of staring at it will not.