title: Why are libcpp.vector so slow?
body: <p>I'm making a few experimentations using Cython to determine whether I should use it to speed up some parts of my Django modules.
  Since I'm using a lot of strings and lists of strings, I tried this:</p>
  
  <pre><code>from libcpp.string cimport string
  from libcpp.vector cimport vector
  
  def cython_test_string():
      cdef unsigned short int i = 0
      cdef string s
      # cdef vector[string] ls
      for i in range(10000):
          s.append('a')
          # ls.push_back(s)
  
  def python_test_string():
      s = ''
      # ls = []
      for i in range(10000):
          s += 'a'
          # ls.append(s)
  </code></pre>
  
  <p>Of course, C++ strings are faster than Python objects, so we get these results (for 100 iterations):</p>
  
  <ul>
  <li>Cython : 0.0110609531403 seconds </li>
  <li>Python : 0.193608045578 seconds</li>
  </ul>
  
  <p>But when we uncomment the four lines that deal with vector and list, we get this:</p>
  
  <ul>
  <li>Cython : 2.80126094818 seconds</li>
  <li>Python : 2.13021802902 seconds</li>
  </ul>
  
  <p>Am I missing something, or are vectors of strings extremely slow?</p>