r1 - 22 Oct 2004 - 18:18:46 - TedLeungYou are here: OSAF >  Journal Web  >  TWikiUsers > TedLeung > TedLeungNotes > TedLeung20041022

Notes

Investigated ItemPerformance

I took a quick look at this by instrumenting parcels.osaf.framework.blocks.View#broadcast with hotshot.

Here are the results of starting up chandler and clicking around on dates in the mini calendar

>>> import hotshot, hotshot.stats
>>> stats = hotshot.stats.load("app.hotshot")
>>> stats.strip_dirs()
<pstats.Stats instance at 0x97850>
>>> stats.sort_stats('time','calls')
<pstats.Stats instance at 0x97850>
>>> stats.print_stats(30)
         171612 function calls (166184 primitive calls) in 5.740 CPU seconds

   Ordered by: internal time, call count

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
    11232    1.253    0.000    1.253    0.000 Item.py:143(__setattr__)
     9224    1.168    0.000    1.168    0.000 UUID.py:73(__eq__)
    11160    1.096    0.000    1.294    0.000 LinkedMap.py:356(iterkeys)
    11232    0.500    0.000    1.956    0.000 Item.py:486(getAttributeValue)
  5472/44    0.281    0.000    5.740    0.130 Views.py:44(broadcast1)
    11376    0.239    0.000    1.434    0.000 LinkedMap.py:107(_get)
    11232    0.160    0.000    2.116    0.000 Item.py:133(__getattr__)
     5428    0.158    0.000    0.158    0.000 Views.py:14(callMethod)
     5616    0.151    0.000    1.717    0.000 Views.py:101(<lambda>)
    11160    0.133    0.000    3.033    0.000 LinkedMap.py:351(__iter__)
    11232    0.109    0.000    0.109    0.000 Item.py:2266(_countAccess)
     5688    0.099    0.000    1.500    0.000 RefCollections.py:505(_getRef)
     5688    0.093    0.000    0.093    0.000 Item.py:1158(isNew)
    11160    0.077    0.000    1.371    0.000 RefCollections.py:842(iterkeys)
     5472    0.074    0.000    0.093    0.000 Values.py:355(_getRef)
     5688    0.037    0.000    1.308    0.000 LinkedMap.py:132(__getitem__)
     5472    0.035    0.000    0.035    0.000 LinkedMap.py:323(firstKey)
     5688    0.028    0.000    1.528    0.000 RefCollections.py:303(__getitem__)
    11376    0.026    0.000    0.026    0.000 UUID.py:60(__hash__)
     5472    0.011    0.000    0.011    0.000 RefCollections.py:49(_isUUID)
     5472    0.009    0.000    0.009    0.000 RefCollections.py:43(_isRefList)
       72    0.001    0.000    0.009    0.000 Views.py:83(<lambda>)
        0    0.000             0.000          profile:0(profiler)


<pstats.Stats instance at 0x97850>

The top 3 methods are Item.__setattr__, UUID.__eq__, and LinkedMap.iterkeys.

-- TedLeung - 22 Oct 2004

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r1 | More topic actions
 
Open Source Applications Foundation
Except where otherwise noted, this site and its content are licensed by OSAF under an Creative Commons License, Attribution Only 3.0.
See list of page contributors for attributions.