I guess I'm going to go ahead and give the same answer(s) that most people have already given here, and that is to know how you react, how you act in your sleep, how quickly you wake up, etc. before deciding exactly what to do with your gun.
I sleep with a handgun (currently P2000 but soon to be 1911 when it comes back from the smith) in the nightstand drawer, empty chamber. My thought process here is twofold:
1) I don't sleepwalk, but sometimes I do / say things in my sleep that I may not be aware of and my wife tells me about the next morning - ESPECIALLY if I've taken any medication like Benadryl (which makes me sleep VERY heavily, but my allergies can get pretty rough so sometimes I've gotta take it).
2) REM sleep is a rough thing to shake off - I don't think I'm the only one who sometimes wakes right up very easily and feeling refreshed after 6 hours of sleep, and sometimes has to be drug out of bed and can't shake it with 3 cups of coffee after 8 hours... if your sleep cycles are consistent and you always wake up at the same time in the morning / always go to bed at the same time every night, you may never wake up in that groggy haze in the morning, but everyone dreams (you may not remember them, but you do), and when you're in that particular phase of the sleep cycle, it is VERY difficult to shake it off. If awoken by my wife at o'dark thirty, who knows what my brain's status might be at any given moment?
3) I love my wife more than anything and, even if I've never touched a gun in my sleep, I want to do everything in my power to ensure I never do by accident. That sort of thing is the mistake you only get to make once, and it's not worth it to me, no matter what.
So to balance those concerns against the need for a serviceable weapon, I think the drawer works well for me. All I have to do is roll over, pull the drawer open with my right hand, grab the gun with my left, rack the slide and I'm ready to go (I'm a southpaw). Plus, the sound of that slide racking serves the dual purpose of alerting whoever is in my home that they should be heading for the door, so maybe that would give me a little extra advantage in the moment of truth (assuming they are rationally frightened by the sound of an action working).
Also, from a different standpoint, dragging that drawer open and racking the top of the slide are more gross motor movements that might be easier to execute properly under stress than manipulating a manual safety or opening a thumb break on a holster, although that is very much debateable and I don't intend to argue that point very far.
One other thing that is important to me, though it might be different for you - by keeping the gun in the nightstand, I don't have to worry about when we have visitors over being frightened / covetous, since it's out of sight and they have no reason to get in there. Seeing it on the top of the table might send the wrong message to people I might not want to know what I've got.
Just my decisions on the matter, FWIW.