title: Performance issues mongo on windows
body: <p>We have built a system where videos are stored in mongodb. The videos are each a couple of hundred megabytes in size. The system is built in python3 using mongoengine. The c extensions of pymongo and bson are installed.</p>
  
  <p>The definition of the mongoengine documents is:</p>
  
  <pre><code>class VideoStore(Document, GeneralMixin):
      video = EmbeddedDocumentListField(SingleFrame)
      mutdat = DateTimeField()
      _collection = 'VideoStore'
  
      def gen_video(self):
          for one_frame in self.video:
              yield self._get_single_frame(one_frame)
  
      def _get_single_frame(self, one_frame):
          if one_frame.frame.tell() != 0:
              one_frame.frame.seek(0)
          return pickle.loads(one_frame.frame.read())
  
  
  class SingleFrame(EmbeddedDocument):
      frame = FileField()
  </code></pre>
  
  <p>Reading a video in Linux takes about 3 to 4 seconds. However running the same code in Windows takes 13 to 17 seconds.</p>
  
  <p>Does anyone out there have any experience with this problem and any kind of solution?</p>
  
  <p>I have thought of and tested (to no avail):</p>
  
  <ol>
  <li>increasing the chunksize</li>
  <li>reading the video as a single blob without using yield</li>
  <li>Storing the file as a single blob (so no storing of separate frames)</li>
  </ol>