[ 
https://issues.apache.org/jira/browse/QPID-2712?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Justin Ross closed QPID-2712.
-----------------------------
    Resolution: Won't Fix

Forward development for Python is now focused on the Proton Python binding.  As 
a result, we are considering only defects and minor improvements for the Python 
qpid.messaging API.  These issues are closed "won't fix" because they are 
improvements outside of that scope.

> Use more efficient pickle protocol for caching specs file
> ---------------------------------------------------------
>
>                 Key: QPID-2712
>                 URL: https://issues.apache.org/jira/browse/QPID-2712
>             Project: Qpid
>          Issue Type: Improvement
>          Components: Python Client
>    Affects Versions: 0.7
>            Reporter: Jeff Laughlin
>            Priority: Trivial
>
> By default, pickle uses protocol 0. This is text based and relatively slow. 
> Calling pickle.dump with -1 as the 3rd argument, python will use the highest 
> available pickle protocol, typically protocol 2 since python 2.3, which is 
> binary, and relatively fast (and uses less space). When loading, pickle 
> automatically determines what format was used to dump. 
> There's really no reason NOT to use the highest protocol in this application. 
> This isn't for data interchange. Since this is for local caching only, it's 
> unlikely that saving in the highest pickle version would ever cause a 
> backwards compatibility issue.  Maybe if somebody was using two drastically 
> different versions of python on the same system...
> See also http://www.python.org/dev/peps/pep-0307/
> This requires changing one line of code.
> --- qpid/ops.py (revision 959828)
> +++ qpid/ops.py (working copy)
> @@ -260,7 +260,7 @@
>      types = load_types_from_xml(file)
>      if os.access(os.path.dirname(os.path.abspath(pclfile)), os.W_OK):
>        f = open(pclfile, "wb")
> -      pickle.dump(types, f)
> +      pickle.dump(types, f, -1)
>        f.close()
>    return types
>  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to