Python 2.6 JSON decoding performance

后端 未结 7 1322
春和景丽
春和景丽 2020-11-30 05:30

I\'m using the json module in Python 2.6 to load and decode JSON files. However I\'m currently getting slower than expected performance. I\'m using a test case

7条回答
  •  猫巷女王i
    2020-11-30 06:14

    Looking in my installation of Python 2.6.1 on windows, the json package loads the _json module, which is built into the runtime. C source for the json speedups module is here.

    >>> import _json
    >>> _json
    
    >>> print _json.__doc__
    json speedups
    >>> dir(_json)
    ['__doc__', '__name__', '__package__', 'encode_basestring_ascii', 'scanstring']
    >>> 
    

提交回复
热议问题