another one with totally identical setup

web2py:
model:
-------
db=SQLDB('sqlite://storage.db')
db.define_table('page',
    SQLField('title'),
    SQLField('body','text'))
-------
controller
-------
def index():
    mypages=db().select
(db.page.id,db.page.title,orderby=db.page.title)
    return dict(pages=mypages)
-------
view
-------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";>
<html>
  <head>
    <title>QuickWiki 6</title>
  </head>
  <body>
    <div class="content">
      {{include}}
    </div>
  </body>
</html>
-------
{{extend 'layout.html'}}
<h1 class="main">Title List</h1>
<ul id="titles">
{{for page in pages:}}
<li>
<span>{{=page.title}}</span>
&nbsp;[{{=A("visit",_href=URL(r=request,f='show',args=[page.id]))}}]
</li>
{{pass}}
</ul>



pylons:
model:
-----
import quickwiki.lib.helpers as h

from pylons import config
from sqlalchemy import Column, MetaData, Table, types
from sqlalchemy.orm import mapper
from sqlalchemy.orm import scoped_session, sessionmaker
Session = scoped_session(sessionmaker(autoflush=True,
transactional=True,
                                      bind=config
['pylons.g'].sa_engine))
metadata = MetaData()
pages_table = Table('pages', metadata,
    Column('title', types.Unicode(40), primary_key=True),
    Column('content', types.Unicode(), default='')
)
class Page(object):
    content = None

    def __str__(self):
        return self.title
mapper(Page, pages_table)
-------
controller
-------
from quickwiki.model import Page
from quickwiki.lib.base import *
    def list(self):
        c.titles = [page.title for page in Session.query(Page).all()]
        return render('/list.mako')
--------
template
--------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";>
<html>
  <head>
    <title>QuickWiki 6</title>
  </head>
  <body>
    <div class="content">
      ${next.body()}
    </div>
  </body>
</html>
----------------
<%inherit file="base.mako"/>
<h1 class="main">Title List</h1>
<ul id="titles">
% for title in c.titles:
<li>
<span>${title}</span>
 &nbsp;[${h.link_to('visit', h.url_for(title=title, action="index"))}]
</li>
% endfor
</ul>
-----------------



benchmark

web2py
Server Software:        Apache/2.2.3
Server Hostname:        10.8.8.18
Server Port:            80

Document Path:          /welcometest/wiki
Document Length:        895 bytes

Concurrency Level:      1
Time taken for tests:   6.398 seconds
Complete requests:      100
Failed requests:        0
Write errors:           0
Total transferred:      129000 bytes
HTML transferred:       89500 bytes
Requests per second:    15.63 [#/sec] (mean)
Time per request:       63.977 [ms] (mean)
Time per request:       63.977 [ms] (mean, across all concurrent
requests)
Transfer rate:          19.69 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    1   2.4      0      20
Processing:    49   63  16.2     56     130
Waiting:       49   63  16.1     56     130
Total:         49   64  16.3     57     130

Percentage of the requests served within a certain time (ms)
  50%     57
  66%     64
  75%     69
  80%     75
  90%     85
  95%    100
  98%    122
  99%    130
 100%    130 (longest request)

pylons
Server Software:        Apache/2.2.3
Server Hostname:        10.8.8.17
Server Port:            80

Document Path:          /wiki/page/list
Document Length:        895 bytes

Concurrency Level:      1
Time taken for tests:   6.188 seconds
Complete requests:      100
Failed requests:        0
Write errors:           0
Total transferred:      109660 bytes
HTML transferred:       89500 bytes
Requests per second:    16.16 [#/sec] (mean)
Time per request:       61.884 [ms] (mean)
Time per request:       61.884 [ms] (mean, across all concurrent
requests)
Transfer rate:          17.30 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.8      0       9
Processing:    49   61  13.7     58     130
Waiting:       48   61  13.7     58     129
Total:         49   62  13.8     58     130

Percentage of the requests served within a certain time (ms)
  50%     58
  66%     61
  75%     65
  80%     68
  90%     81
  95%     86
  98%    111
  99%    130
 100%    130 (longest request)



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to