You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Jeff Hammerbacher (JIRA)" <ji...@apache.org> on 2009/11/25 07:51:44 UTC

[jira] Created: (AVRO-240) For Python 2.6 and above, use "json" module from stdlib instead of simplejson

For Python 2.6 and above, use "json" module from stdlib instead of simplejson
-----------------------------------------------------------------------------

                 Key: AVRO-240
                 URL: https://issues.apache.org/jira/browse/AVRO-240
             Project: Avro
          Issue Type: Improvement
          Components: python
            Reporter: Jeff Hammerbacher


As described at http://bob.pythonmac.org/archives/2008/10/02/python-26-released-now-with-json/:

# Use simplejson or Python 2.6 json, prefer simplejson.
try:
    import simplejson as json
except ImportError:
    import json


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AVRO-240) For Python 2.6 and above, use "json" module from stdlib instead of simplejson

Posted by "Jeff Hammerbacher (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-240?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeff Hammerbacher updated AVRO-240:
-----------------------------------

    Attachment: AVRO-240.patch

Attached patch also cleans up the import style at the top of procol.py to match PEP 8 style guidelines.

> For Python 2.6 and above, use "json" module from stdlib instead of simplejson
> -----------------------------------------------------------------------------
>
>                 Key: AVRO-240
>                 URL: https://issues.apache.org/jira/browse/AVRO-240
>             Project: Avro
>          Issue Type: Improvement
>          Components: python
>            Reporter: Jeff Hammerbacher
>            Assignee: Jeff Hammerbacher
>         Attachments: AVRO-240.patch
>
>
> As described at http://bob.pythonmac.org/archives/2008/10/02/python-26-released-now-with-json/:
> # Use simplejson or Python 2.6 json, prefer simplejson.
> try:
>     import simplejson as json
> except ImportError:
>     import json

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AVRO-240) For Python 2.6 and above, use "json" module from stdlib instead of simplejson

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782578#action_12782578 ] 

Doug Cutting commented on AVRO-240:
-----------------------------------

+1 This looks reasonable to me.  It lets things still work when simplejson is not available, right?  Unless there are objections, I will commit this.

> For Python 2.6 and above, use "json" module from stdlib instead of simplejson
> -----------------------------------------------------------------------------
>
>                 Key: AVRO-240
>                 URL: https://issues.apache.org/jira/browse/AVRO-240
>             Project: Avro
>          Issue Type: Improvement
>          Components: python
>            Reporter: Jeff Hammerbacher
>            Assignee: Jeff Hammerbacher
>         Attachments: AVRO-240.patch
>
>
> As described at http://bob.pythonmac.org/archives/2008/10/02/python-26-released-now-with-json/:
> # Use simplejson or Python 2.6 json, prefer simplejson.
> try:
>     import simplejson as json
> except ImportError:
>     import json

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AVRO-240) For Python 2.6 and above, use "json" module from stdlib instead of simplejson

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-240?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Cutting updated AVRO-240:
------------------------------

       Resolution: Fixed
    Fix Version/s: 1.3.0
     Hadoop Flags: [Reviewed]
           Status: Resolved  (was: Patch Available)

I just committed this.  Thanks, Jeff.

> For Python 2.6 and above, use "json" module from stdlib instead of simplejson
> -----------------------------------------------------------------------------
>
>                 Key: AVRO-240
>                 URL: https://issues.apache.org/jira/browse/AVRO-240
>             Project: Avro
>          Issue Type: Improvement
>          Components: python
>            Reporter: Jeff Hammerbacher
>            Assignee: Jeff Hammerbacher
>             Fix For: 1.3.0
>
>         Attachments: AVRO-240.patch
>
>
> As described at http://bob.pythonmac.org/archives/2008/10/02/python-26-released-now-with-json/:
> # Use simplejson or Python 2.6 json, prefer simplejson.
> try:
>     import simplejson as json
> except ImportError:
>     import json

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AVRO-240) For Python 2.6 and above, use "json" module from stdlib instead of simplejson

Posted by "Jeff Hammerbacher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782579#action_12782579 ] 

Jeff Hammerbacher commented on AVRO-240:
----------------------------------------

Doug: this will not work when simplejson is not available for Python 2.5 and below, but there is no json parsing library in the standard library before Python 2.6. It will work when simplejson is not available for Python 2.6 and above.

> For Python 2.6 and above, use "json" module from stdlib instead of simplejson
> -----------------------------------------------------------------------------
>
>                 Key: AVRO-240
>                 URL: https://issues.apache.org/jira/browse/AVRO-240
>             Project: Avro
>          Issue Type: Improvement
>          Components: python
>            Reporter: Jeff Hammerbacher
>            Assignee: Jeff Hammerbacher
>         Attachments: AVRO-240.patch
>
>
> As described at http://bob.pythonmac.org/archives/2008/10/02/python-26-released-now-with-json/:
> # Use simplejson or Python 2.6 json, prefer simplejson.
> try:
>     import simplejson as json
> except ImportError:
>     import json

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AVRO-240) For Python 2.6 and above, use "json" module from stdlib instead of simplejson

Posted by "Jeff Hammerbacher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782679#action_12782679 ] 

Jeff Hammerbacher commented on AVRO-240:
----------------------------------------

Still ready to commit, though.

> For Python 2.6 and above, use "json" module from stdlib instead of simplejson
> -----------------------------------------------------------------------------
>
>                 Key: AVRO-240
>                 URL: https://issues.apache.org/jira/browse/AVRO-240
>             Project: Avro
>          Issue Type: Improvement
>          Components: python
>            Reporter: Jeff Hammerbacher
>            Assignee: Jeff Hammerbacher
>         Attachments: AVRO-240.patch
>
>
> As described at http://bob.pythonmac.org/archives/2008/10/02/python-26-released-now-with-json/:
> # Use simplejson or Python 2.6 json, prefer simplejson.
> try:
>     import simplejson as json
> except ImportError:
>     import json

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AVRO-240) For Python 2.6 and above, use "json" module from stdlib instead of simplejson

Posted by "Jeff Hammerbacher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782518#action_12782518 ] 

Jeff Hammerbacher commented on AVRO-240:
----------------------------------------

While we can have an accelerated implementation (cf. Thrift's binary protocol) and do significant benchmarking at AVRO-217, I think the best practice right now is to use the standard library.

> For Python 2.6 and above, use "json" module from stdlib instead of simplejson
> -----------------------------------------------------------------------------
>
>                 Key: AVRO-240
>                 URL: https://issues.apache.org/jira/browse/AVRO-240
>             Project: Avro
>          Issue Type: Improvement
>          Components: python
>            Reporter: Jeff Hammerbacher
>            Assignee: Jeff Hammerbacher
>         Attachments: AVRO-240.patch
>
>
> As described at http://bob.pythonmac.org/archives/2008/10/02/python-26-released-now-with-json/:
> # Use simplejson or Python 2.6 json, prefer simplejson.
> try:
>     import simplejson as json
> except ImportError:
>     import json

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (AVRO-240) For Python 2.6 and above, use "json" module from stdlib instead of simplejson

Posted by "Jeff Hammerbacher (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-240?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeff Hammerbacher reassigned AVRO-240:
--------------------------------------

    Assignee: Jeff Hammerbacher

> For Python 2.6 and above, use "json" module from stdlib instead of simplejson
> -----------------------------------------------------------------------------
>
>                 Key: AVRO-240
>                 URL: https://issues.apache.org/jira/browse/AVRO-240
>             Project: Avro
>          Issue Type: Improvement
>          Components: python
>            Reporter: Jeff Hammerbacher
>            Assignee: Jeff Hammerbacher
>
> As described at http://bob.pythonmac.org/archives/2008/10/02/python-26-released-now-with-json/:
> # Use simplejson or Python 2.6 json, prefer simplejson.
> try:
>     import simplejson as json
> except ImportError:
>     import json

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (AVRO-240) For Python 2.6 and above, use "json" module from stdlib instead of simplejson

Posted by "Jeff Hammerbacher (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-240?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeff Hammerbacher updated AVRO-240:
-----------------------------------

    Status: Patch Available  (was: Open)

> For Python 2.6 and above, use "json" module from stdlib instead of simplejson
> -----------------------------------------------------------------------------
>
>                 Key: AVRO-240
>                 URL: https://issues.apache.org/jira/browse/AVRO-240
>             Project: Avro
>          Issue Type: Improvement
>          Components: python
>            Reporter: Jeff Hammerbacher
>            Assignee: Jeff Hammerbacher
>         Attachments: AVRO-240.patch
>
>
> As described at http://bob.pythonmac.org/archives/2008/10/02/python-26-released-now-with-json/:
> # Use simplejson or Python 2.6 json, prefer simplejson.
> try:
>     import simplejson as json
> except ImportError:
>     import json

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (AVRO-240) For Python 2.6 and above, use "json" module from stdlib instead of simplejson

Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782502#action_12782502 ] 

Patrick Hunt commented on AVRO-240:
-----------------------------------

fyi, noticed this recently, it's a python json lib performance evaluation on python 2.6. You might want to
add some detail in the avro py docs talking about how to get better/best performance, esp as it
relates to the json library used (json stdlib performance is an order of magnitude behind the others tested)

"I honestly didn't expect the stdlib json to be this far behind.

Among the other C based libraries there isn't a clear winner. cjson is the best decoder but the slowest encoder, simplejson compiled with C speedups is the fastest encoder but the slowest decoder while jsonlib2 is somewhere in the middle for both cases."

http://www.mikealrogers.com/archives/695


> For Python 2.6 and above, use "json" module from stdlib instead of simplejson
> -----------------------------------------------------------------------------
>
>                 Key: AVRO-240
>                 URL: https://issues.apache.org/jira/browse/AVRO-240
>             Project: Avro
>          Issue Type: Improvement
>          Components: python
>            Reporter: Jeff Hammerbacher
>            Assignee: Jeff Hammerbacher
>         Attachments: AVRO-240.patch
>
>
> As described at http://bob.pythonmac.org/archives/2008/10/02/python-26-released-now-with-json/:
> # Use simplejson or Python 2.6 json, prefer simplejson.
> try:
>     import simplejson as json
> except ImportError:
>     import json

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.