dan mackinlay  committed ca84a39

binary protocol for pickling performance

  • Participants
  • Parent commits 59c560a
  • Branches 0.2

Comments (0)

Files changed (1)

     Note that this is not completely symmtrical with FSDict, which will store
     *only* strings in values; this will store *anything but* FSDicts in
+    This uses the binary-only protocol=2, for performance.
+    An infrastructure which supported more general serialisation might be
+    smart.
     def __setitem__(self, item, value):
         if item in self:
         else: #pickle it!
             with self._handle_factory(fn, 'wb') as f:
-                pickle.dump(value, f)
+                pickle.dump(value, f, protocol=2)
     def __getitem__(self, item):
         fn = self._get_path(item)