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

Andrew Onischuk resolved AMBARI-11529.
--------------------------------------
    Resolution: Fixed

Committed to trunk

> Work with json module takes too long
> ------------------------------------
>
>                 Key: AMBARI-11529
>                 URL: https://issues.apache.org/jira/browse/AMBARI-11529
>             Project: Ambari
>          Issue Type: Bug
>            Reporter: Andrew Onischuk
>            Assignee: Andrew Onischuk
>             Fix For: 2.1.0
>
>
> Due to profiling below, from 420 seconds of deploy json.load and json.loads
> take 40 seconds (which even doesn't include working with json in ambari-agent
> itself, only script):
>     
>     
>           204    0.007    0.000   20.182    0.099 __init__.py:243(load)
>           351    0.002    0.000   17.894    0.051 __init__.py:270(loads)
>     
> This is because json module for Python 2.6 is extremety slow. There are
> benchmark for it on here:  
> <http://stackoverflow.com/questions/706101/python-json-decoding-performance>
> due to it simplejson is at least ~40 times faster for deserializing.
> Also another thing to do in scope of this jira is to replace inspect module
> usage with os._getframe() which doesn't use realpath function that
> intensively, taking away 10 more seconds.
>     
>     
>     30049/21438    1.712    0.000   10.873    0.001 posixpath.py:354(realpath)
>     



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

Reply via email to