This is the most important page of a wiki, and its dynamic, we don't have any caching here

Patch 467

ab -n 101 -c 1 http://localhost:8000/RecentChanges

Requests per second:    5.89 [#/sec] (mean)

         738184 function calls (694984 primitive calls) in 32.055 CPU seconds

   Ordered by: internal time, call count
   List reduced from 259 to 20 due to restriction <20>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
42700/19100    9.689    0.000   15.589    0.001 Page.py:78(get_rev)
    48900    2.338    0.000    2.339    0.000 posixpath.py:171(exists)
     1800    2.295    0.001   12.600    0.007 RecentChanges.py:43(format_page_edits)
   166400    2.187    0.000    2.187    0.000 posixpath.py:56(join)
      100    1.462    0.015    1.549    0.015 wikidicts.py:300(scandicts)
     5500    1.098    0.000    1.098    0.000 request.py:444(encode)
     8100    1.073    0.000    2.627    0.000 request.py:139(__getattr__)
      500    1.052    0.002   23.640    0.047 wikimacro.py:98(execute)
      100    1.012    0.010   32.055    0.321 request.py:670(run)
      100    1.008    0.010    3.812    0.038 modern.py:38(header)
39500/19900    0.827    0.000   10.803    0.001 Page.py:120(getPagePath)
    39500    0.816    0.000    0.817    0.000 wikiutil.py:154(quoteWikinameFS)
     1400    0.695    0.000    0.884    0.001 pysupport.py:37(importName)
    27100    0.454    0.000    0.454    0.000 wikiutil.py:113(escape)
     9600    0.380    0.000    0.380    0.000 wikiutil.py:75(quoteWikinameURL)
      500    0.309    0.001    0.448    0.001 user.py:341(load_from_id)
      600    0.299    0.000    0.496    0.001 logfile.py:17(__init__)
     4500    0.232    0.000    1.847    0.000 wikiacl.py:185(may)
     8100    0.215    0.000    0.322    0.000 wikiutil.py:772(link_tag)
     4000    0.200    0.000    0.362    0.000 editlog.py:125(parser)


   Ordered by: internal time, call count
   List reduced from 259 to 20 due to restriction <20>

Function                                was called by...
Page.py:78(get_rev)                      Page.py:120(getPagePath)(24200)   10.803
                                         Page.py:199(_text_filename)(4900)    5.026
                                         Page.py:332(exists)(13600)   10.690
posixpath.py:171(exists)                 Page.py:78(get_rev)(42700)   15.589
                                         Page.py:120(getPagePath)(500)   10.803
                                         Page.py:332(exists)(500)   10.690
                                         Page.py:1266(getACL)(4500)    5.100
                                         caching.py:37(exists)(200)    0.007
                                         user.py:320(exists)(500)    0.031
RecentChanges.py:43(format_page_edits)   RecentChanges.py:215(execute)(1800)   21.617
posixpath.py:56(join)                    Page.py:78(get_rev)(85400)   15.589
                                         Page.py:120(getPagePath)(79000)   10.803
                                         caching.py:13(__init__)(100)    0.059
                                         caching.py:34(_filename)(700)    0.006
                                         user.py:311(__filename)(1000)    0.016
                                         wikiaction.py:836(getPlugins)(200)    0.032
wikidicts.py:300(scandicts)              request.py:556(initdicts)(100)    1.554
request.py:444(encode)                   request.py:1518(write)(5500)    1.354
request.py:139(__getattr__)              Page.py:662(send_page)(100)   30.908
                                         __init__.py:349(make_icon)(6800)    2.381
                                         text_html.py:20(__init__)(100)    1.012
                                         user.py:207(__init__)(1000)    0.540
                                         wikiacl.py:185(may)(100)    1.847
wikimacro.py:98(execute)                 base.py:219(macro)(500)   23.643
request.py:670(run)                      profile:0(profiler)(100)    0.000
modern.py:38(header)                     wikiutil.py:909(send_title)(100)    4.810
Page.py:120(getPagePath)                 AttachFile.py:50(getAttachDir)(100)    0.033
                                         Page.py:78(get_rev)(18500)   15.589
                                         Page.py:120(getPagePath)(19600)   10.803
                                         Page.py:228(_last_edited)(200)    0.122
                                         Page.py:332(exists)(500)   10.690
                                         Page.py:994(send_page_content)(100)   23.990
                                         caching.py:13(__init__)(200)    0.059
                                         editlog.py:74(__init__)(200)    0.029
                                         eventlog.py:13(__init__)(100)    0.014
wikiutil.py:154(quoteWikinameFS)         Page.py:120(getPagePath)(39500)   10.803
pysupport.py:37(importName)              wikiutil.py:515(importPlugin)(1200)    0.795
                                         wikiutil.py:536(builtinPlugins)(100)    0.003
                                         wikiutil.py:550(extensionPlugins)(100)    0.110
wikiutil.py:113(escape)                  Page.py:562(link_to)(5300)    4.523
                                         RecentChanges.py:43(format_page_edits)(700)   12.600
                                         __init__.py:150(title)(100)    0.006
                                         __init__.py:536(searchform)(100)    0.007
                                         base.py:90(image)(13600)    0.260
                                         editlog.py:57(getEditor)(4500)    4.225
                                         text_html.py:251(url)(2600)    0.079
                                         wikiutil.py:909(send_title)(200)    4.810
wikiutil.py:75(quoteWikinameURL)         Page.py:562(link_to)(5300)    4.523
                                         Page.py:662(send_page)(100)   30.908
                                         RecentChanges.py:43(format_page_edits)(2500)   12.600
                                         RecentChanges.py:215(execute)(100)   21.617
                                         __init__.py:131(logo)(100)    0.061
                                         __init__.py:910(editbar)(100)    2.045
                                         wikiutil.py:909(send_title)(1400)    4.810
user.py:341(load_from_id)                user.py:207(__init__)(500)    0.540
logfile.py:17(__init__)                  logfile.py:277(to_end)(600)    0.531
wikiacl.py:185(may)                      security.py:52(<lambda>)(4500)    7.058
wikiutil.py:772(link_tag)                Page.py:562(link_to)(5300)    4.523
                                         RecentChanges.py:43(format_page_edits)(2500)   12.600
                                         __init__.py:131(logo)(100)    0.061
                                         __init__.py:910(editbar)(200)    2.045
editlog.py:125(parser)                   logfile.py:247(__previous)(4000)    0.417

patch 460 + experinamtal refactoring

See PageClassRefactoring

ab -n 101 -c 1 http://localhost:8000/RecentChanges

Requests per second:    10.43 [#/sec] (mean)

         468272 function calls in 18.102 CPU seconds

   Ordered by: internal time, call count
   List reduced from 292 to 20 due to restriction <20>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
     1800    2.863    0.002    3.096    0.002 pysupport.py:37(importName)
     9700    1.365    0.000    1.365    0.000 wikiutil.py:75(quoteWikinameURL)
      100    1.175    0.012    7.877    0.079 RecentChanges.py:215(execute)
     3400    1.120    0.000    1.239    0.000 base.py:90(image)
     4000    1.108    0.000    1.607    0.000 logfile.py:251(previous)
    19800    1.066    0.000    1.995    0.000 Page.py:169(getInfo)
      800    1.026    0.001    4.013    0.005 wikiutil.py:515(importPlugin)
     1300    1.006    0.001    1.006    0.001 string.py:125(join)
      100    0.465    0.005    0.545    0.005 wikidicts.py:300(scandicts)
     4400    0.374    0.000    0.929    0.000 Page.py:185(getInfoForDomain)
     8100    0.321    0.000    0.321    0.000 posixpath.py:171(exists)
      500    0.309    0.001    0.470    0.001 user.py:341(load_from_id)
      600    0.302    0.001    0.509    0.001 logfile.py:17(__init__)
    27100    0.254    0.000    0.254    0.000 wikiutil.py:113(escape)
     1800    0.230    0.000    3.229    0.002 RecentChanges.py:43(format_page_edits)
     4500    0.214    0.000    0.823    0.000 wikiacl.py:185(may)
     1000    0.184    0.000    0.223    0.000 pysupport.py:23(getPackageModules)
     4000    0.181    0.000    0.332    0.000 editlog.py:125(parser)
     6400    0.180    0.000    0.180    0.000 socket.py:237(flush)
     1000    0.177    0.000    0.177    0.000 request.py:32(start)


   Ordered by: internal time, call count
   List reduced from 292 to 20 due to restriction <20>

Function                                was called by...
pysupport.py:37(importName)              wikiutil.py:515(importPlugin)(1600)    4.013
                                         wikiutil.py:536(builtinPlugins)(100)    0.003
                                         wikiutil.py:550(extensionPlugins)(100)    0.107
wikiutil.py:75(quoteWikinameURL)         Page.py:590(link_to)(5300)    1.476
                                         Page.py:690(send_page)(100)   17.675
                                         Page.py:1029(send_page_content)(100)   12.956
                                         RecentChanges.py:43(format_page_edits)(2500)    3.229
                                         RecentChanges.py:215(execute)(100)    7.877
                                         __init__.py:131(logo)(100)    0.015
                                         __init__.py:912(editbar)(100)    0.888
                                         wikiutil.py:909(send_title)(1400)    1.844
RecentChanges.py:215(execute)            wikimacro.py:98(execute)(100)   12.660
base.py:90(image)                        __init__.py:351(make_icon)(3400)    1.563
logfile.py:251(previous)                 Page.py:242(_last_edited)(200)    0.101
                                         logfile.py:82(reverse)(3800)    2.102
Page.py:169(getInfo)                     Page.py:217(_text_filename)(200)    0.002
                                         Page.py:316(isWritable)(100)    0.005
                                         Page.py:329(isUnderlayPage)(100)    0.001
                                         Page.py:345(exists)(13900)    1.551
                                         Page.py:496(get_raw_body)(100)    0.051
                                         Page.py:524(getEventLogPath)(100)    0.002
                                         Page.py:530(getEditLogPath)(400)    0.008
                                         Page.py:536(getAttachmentPath)(200)    0.003
                                         Page.py:548(getCachePath)(200)    0.004
                                         Page.py:1287(getACL)(4500)    0.683
wikiutil.py:515(importPlugin)            Page.py:690(send_page)(100)   17.675
                                         Page.py:1005(canUseCache)(100)    0.134
                                         request.py:264(loadTheme)(100)    0.128
                                         wikimacro.py:98(execute)(500)   12.660
string.py:125(join)                      sre_parse.py:727(expand_template)(1300)    1.020
wikidicts.py:300(scandicts)              request.py:555(initdicts)(100)    0.550
Page.py:185(getInfoForDomain)            Page.py:169(getInfo)(4400)    1.995
posixpath.py:171(exists)                 Page.py:185(getInfoForDomain)(7200)    0.929
                                         Page.py:242(_last_edited)(200)    0.101
                                         caching.py:37(exists)(200)    0.009
                                         user.py:320(exists)(500)    0.037
user.py:341(load_from_id)                user.py:207(__init__)(500)    0.576
logfile.py:17(__init__)                  logfile.py:277(to_end)(600)    0.552
wikiutil.py:113(escape)                  Page.py:590(link_to)(5300)    1.476
                                         RecentChanges.py:43(format_page_edits)(700)    3.229
                                         __init__.py:150(title)(100)    0.006
                                         __init__.py:538(searchform)(100)    0.007
                                         base.py:90(image)(13600)    1.239
                                         editlog.py:57(getEditor)(4500)    2.136
                                         text_html.py:251(url)(2600)    0.073
                                         wikiutil.py:909(send_title)(200)    1.844
RecentChanges.py:43(format_page_edits)   RecentChanges.py:215(execute)(1800)    7.877
wikiacl.py:185(may)                      security.py:52(<lambda>)(4500)    1.588
pysupport.py:23(getPackageModules)       __init__.py:3(?)(600)    0.229
                                         wikiaction.py:836(getPlugins)(100)    0.027
editlog.py:125(parser)                   logfile.py:247(__previous)(4000)    0.384
socket.py:237(flush)                     request.py:1525(flush)(200)    0.001
                                         request.py:1528(finish)(100)    0.087
                                         socket.py:246(write)(6100)    0.229
request.py:32(start)                     Page.py:690(send_page)(400)   17.675
                                         __init__.py:282(navibar)(100)    0.161
                                         __init__.py:912(editbar)(100)    0.888
                                         request.py:669(run)(100)   17.854
                                         wikiutil.py:909(send_title)(200)    1.844
                                         wikiutil.py:1135(send_footer)(100)    2.443

Patch 468

This patch try to fix the get_rev and getPagePath problem by caching those functions results.

ab -n 101 -c 1 http://localhost:8000/RecentChanges

Requests per second:    7.35 [#/sec] (mean)

         660464 function calls (643864 primitive calls) in 25.649 CPU seconds

   Ordered by: internal time, call count
   List reduced from 264 to 20 due to restriction <20>

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
    16700    3.613    0.000    3.704    0.000 Page.py:89(get_current_from_pagedir)
    74800    2.528    0.000    2.528    0.000 posixpath.py:56(join)
    27100    2.269    0.000    2.269    0.000 wikiutil.py:113(escape)
      100    1.467    0.015    1.550    0.016 wikidicts.py:300(scandicts)
35200/18600    1.386    0.000    7.371    0.000 Page.py:122(get_rev)
      500    1.308    0.003    2.461    0.005 user.py:341(load_from_id)
     4000    1.199    0.000    1.369    0.000 editlog.py:125(parser)
     8100    1.192    0.000    2.296    0.000 wikiutil.py:772(link_tag)
      500    1.002    0.002    1.072    0.002 codecs.py:386(readlines)
      200    1.001    0.005    1.002    0.005 text_html.py:51(langAttr)
    22900    0.708    0.000    0.708    0.000 posixpath.py:171(exists)
     1400    0.682    0.000    0.864    0.001 pysupport.py:37(importName)
    12800    0.428    0.000    0.428    0.000 wikiutil.py:154(quoteWikinameFS)
     9600    0.371    0.000    0.371    0.000 wikiutil.py:75(quoteWikinameURL)
    16700    0.323    0.000    2.054    0.000 Page.py:105(get_rev_dir)
      600    0.299    0.000    0.495    0.001 logfile.py:17(__init__)
     1800    0.278    0.000    9.424    0.005 RecentChanges.py:43(format_page_edits)
    12800    0.261    0.000    2.207    0.000 Page.py:62(reset)
    26600    0.235    0.000    7.578    0.000 Page.py:241(getPageStatus)
     4500    0.230    0.000    1.846    0.000 wikiacl.py:185(may)


   Ordered by: internal time, call count
   List reduced from 264 to 20 due to restriction <20>

Function                                was called by...
Page.py:89(get_current_from_pagedir)     Page.py:122(get_rev)(16700)    7.371
posixpath.py:56(join)                    Page.py:62(reset)(12800)    2.207
                                         Page.py:89(get_current_from_pagedir)(16700)    3.704
                                         Page.py:105(get_rev_dir)(16700)    2.054
                                         Page.py:241(getPageStatus)(26600)    7.578
                                         caching.py:13(__init__)(100)    0.021
                                         caching.py:34(_filename)(700)    0.006
                                         user.py:311(__filename)(1000)    0.015
                                         wikiaction.py:836(getPlugins)(200)    0.029
wikiutil.py:113(escape)                  Page.py:664(link_to)(5300)    1.557
                                         RecentChanges.py:43(format_page_edits)(700)    9.424
                                         __init__.py:150(title)(100)    0.006
                                         __init__.py:536(searchform)(100)    0.007
                                         base.py:90(image)(13600)    1.251
                                         editlog.py:57(getEditor)(4500)    4.133
                                         text_html.py:251(url)(2600)    1.078
                                         wikiutil.py:909(send_title)(200)    6.247
wikidicts.py:300(scandicts)              request.py:556(initdicts)(100)    1.555
Page.py:122(get_rev)                     Page.py:176(getPageBasePath)(16700)    6.201
                                         Page.py:296(_text_filename)(4900)    3.206
                                         Page.py:429(exists)(13600)    4.283
user.py:341(load_from_id)                user.py:207(__init__)(500)    2.551
editlog.py:125(parser)                   logfile.py:247(__previous)(4000)    1.425
wikiutil.py:772(link_tag)                Page.py:664(link_to)(5300)    1.557
                                         RecentChanges.py:43(format_page_edits)(2500)    9.424
                                         __init__.py:131(logo)(100)    0.054
                                         __init__.py:910(editbar)(200)    1.945
codecs.py:386(readlines)                 user.py:341(load_from_id)(500)    2.461
text_html.py:51(langAttr)                text_html.py:89(open)(100)    0.005
                                         text_html.py:152(startContent)(100)    1.010
posixpath.py:171(exists)                 Page.py:105(get_rev_dir)(16700)    2.054
                                         Page.py:241(getPageStatus)(500)    7.578
                                         Page.py:429(exists)(500)    4.283
                                         Page.py:1368(getACL)(4500)    3.401
                                         caching.py:37(exists)(200)    0.007
                                         user.py:320(exists)(500)    0.033
pysupport.py:37(importName)              wikiutil.py:515(importPlugin)(1200)    0.775
                                         wikiutil.py:536(builtinPlugins)(100)    0.003
                                         wikiutil.py:550(extensionPlugins)(100)    0.109
wikiutil.py:154(quoteWikinameFS)         Page.py:62(reset)(12800)    2.207
wikiutil.py:75(quoteWikinameURL)         Page.py:664(link_to)(5300)    1.557
                                         Page.py:764(send_page)(100)   25.496
                                         RecentChanges.py:43(format_page_edits)(2500)    9.424
                                         RecentChanges.py:215(execute)(100)   15.164
                                         __init__.py:131(logo)(100)    0.054
                                         __init__.py:910(editbar)(100)    1.945
                                         wikiutil.py:909(send_title)(1400)    6.247
Page.py:105(get_rev_dir)                 Page.py:122(get_rev)(16700)    7.371
logfile.py:17(__init__)                  logfile.py:277(to_end)(600)    0.534
RecentChanges.py:43(format_page_edits)   RecentChanges.py:215(execute)(1800)   15.164
Page.py:62(reset)                        Page.py:26(__init__)(12800)    2.352
Page.py:241(getPageStatus)               Page.py:122(get_rev)(12400)    7.371
                                         Page.py:272(getPagePath)(14200)    1.457
wikiacl.py:185(may)                      security.py:52(<lambda>)(4500)    5.763

MoinMoin: MoinProfiling/RecentChanges (last edited 2007-10-29 19:13:34 by localhost)