Sleep is crucial for memory consolidation.
During sleep (especially SWS and REM), the brain transfers information from the hippocampus (short-term) to the neocortex (long-term) and clears out metabolic waste.
Pulling an all-nighter is counterproductive for learning.
Cognitive
Sleep & Memory
Sleep is the save button for memory