Q:

Why are vectors so shallow?

What is the rationale behind Scala's vectors having a branching factor of 32, and not some other number? Wouldn't smaller branching factors enable more structural sharing? Clojure seems to use the same branching factor. Is there anything magic about the branching factor 32 that I am missing?

A:

It would help if you explained what a branching factor is:
The branching factor of a tree or a graph is the number of children at each node.
So, the answer appears to be largely here:
http://www.scala-lang.org/docu/files/collections-api/collections_15.html

Vectors are represented as trees with a high branching factor. Every
  tree node contains up to 32 elements of the vector or contains up to
  32 other tree nodes. Vectors with up to 32 elements can be represented
  in a single node. Vectors with up to 32 * 32 = 1024 elements can be
  represented with a single indirection. Two hops from the root of the
  tree to the final element node are sufficient for vectors with up to
  215 elements, three hops for vectors with 220, four hops for vectors
  with 225 elements and five hops for vectors with up to 230 elements.
  So for all vectors of reasonable size, an element selection involves
  up to 5 primitive array selections. This is what we meant when we
  wrote that element access is "effectively constant time".

So, basically, they had to make a design decision as to how many children to have at each node.  As they explained, 32 seemed reasonable, but, if you find that it is too restrictive for you, then you could always write your own class.
For more information on why it may have been 32, you can look at this paper, as in the introduction they make the same statement as above, about it being nearly constant time, but this paper deals with Clojure it seems, more than Scala.
http://infoscience.epfl.ch/record/169879/files/RMTrees.pdf

A:

James Black's answer is correct. Another argument for choosing 32 items might have been that the cache line size in many modern processors is 64 bytes, so two lines can hold 32 ints with 4 bytes each or 32 pointers on a 32bit machine or a 64bit JVM with a heap size up to 32GB due to pointer compression.

A:

It's the "effectively constant time" for updates.  With that large of a branching factor, you never have to go beyond 5 levels, even for terabyte-scale vectors.  Here's a video with Rich talking about that and other aspects of Clojure on Channel 9.  http://channel9.msdn.com/Shows/Going+Deep/Expert-to-Expert-Rich-Hickey-and-Brian-Beckman-Inside-Clojure

