title: What are the differences between slices and partitions of RDDs?
body: <p>I am using Spark's Python API and running Spark 0.8.</p>
  
  <p>I am storing a large RDD of floating point vectors and I need to perform calculations of one vector against the entire set.  </p>
  
  <p>Is there any difference between slices and partitions in an RDD?  </p>
  
  <p>When I create the RDD, I pass it 100 as a parameter which causes it to store the RDD as 100 slices and create 100 tasks when performing the calculations.  I want to know if partitioning the data would improve performance beyond the slicing by enabling the system to process the data more efficiently (i.e. is there a difference between performing operations over a partition versus over just operating over every element in the sliced RDD).</p>
  
  <p>For example, is there any significant difference between these two pieces of code?</p>
  
  <pre><code>rdd = sc.textFile(demo.txt, 100)
  </code></pre>
  
  <p>vs</p>
  
  <pre><code>rdd = sc.textFile(demo.txt)
  rdd.partitionBy(100)
  </code></pre>