File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,9 @@ To unpack it to list, Use ``use_list`` option.
4242 >>> msgpack.unpackb(b ' \x93\x01\x02\x03 ' , use_list = True )
4343 [1, 2, 3]
4444
45+ The default behavior will be changed in the future. (probably 0.4)
46+ You should always pass the ``use_list `` keyword argument.
47+
4548Read the docstring for other options.
4649
4750
@@ -151,6 +154,27 @@ or Windows SDK on Windows. (NOTE: Visual C++ Express 2010 doesn't support
151154amd64. Windows SDK is recommanded way to build amd64 msgpack without any fee.)
152155
153156
157+ PERFORMANCE NOTE
158+ -----------------
159+
160+ GC
161+ ^^
162+
163+ CPython's GC starts when growing allocated object.
164+ This means unpacking may cause useless GC.
165+ You can use ``gc.disable() `` when unpacking large message.
166+
167+ use_list
168+ ^^^^^^^^^
169+ List is the default sequence type of Python.
170+ But tuple is lighter than list.
171+ You can use ``use_list=False `` while unpacking when performance is important.
172+
173+ Python's dict can't use list as key and MessagePack allows array for key of mapping.
174+ ``use_list=False `` allows unpacking such message.
175+ Another way to unpacking such object is using ``object_pairs_hook ``.
176+
177+
154178TEST
155179----
156180MessagePack uses `nosetest ` for testing.
You can’t perform that action at this time.
0 commit comments