Carl Sagan said this quote

Much more plausible is the computer-based explanation that dreams are a spillover from the unconscious processing of the day's experience, from the brain's decision on how much of the daily events temporarily stored in a kind of buffer to emplace in long-term memory... The American psychiatrist Ernest Hartmann of Tufts University has providedanecdotal but reasonably persuasive evidence that people who are engaged in intellectual activities during the day, especially unfamiliar intellectual activities, require more sleep at night, while, by and large, those engaged in mainly repetitive and intellectually unchallenging tasks are able to do with much less sleep.