Take 15min naps every 3-4 hour, like being in übermann sleep mode... it may take some practice to actually just fall asleep and then wake up again in 15-25min but rebooting the brain by doing it really helps me to think clearly again.
Napping too long though will not work, as at least I will feel less rested and possibly even more sleepy than before if it's not truly a quick nap. Not being able to truly fall asleep briefly during the nap will also prevent any effect, obviously.
A 3 hour sleep may be easier to do and will, for most people I guess, include a deep sleep cycle and relieve the mind of more stress. It might feel a bit tiresome getting up but that should quickly pass, especially with some added activity like PE and/or breakfast ^^
But I'd lean towards the "don't do it" side in practice. Only if it's a hobby project of mine I really care for - I'd pull all-nighters just for the fun of it. I do experience deadline problems with some of my technical writing side-jobs but I usually just spend a few hours on it, go to sleep and then get up really early and be done around lunch that day instead of trying to have it ready in the morning.