What are the primary differences between Spark and Hadoop in terms of processing speed and memory management?