seedifferently / the-great-web-framework-shootout

Benchmarks and test code for The Great Web Framework Shootout [DEPRECATED -- See techempower's benchmarks instead]
http://blog.curiasolutions.com/pages/the-great-web-framework-shootout.html
295 stars 27 forks source link

add web2py #14

Open mdipierro opened 12 years ago

mdipierro commented 12 years ago
wget http://web2py.com/examples/static/web2py_src.zip
unzip web2py_src.zip
cd web2py
mkdir applications/benchmark
cp -r applications/welcome/* applications/benchmark
rm applications/benchmark/models/*
echo """
import sqlite3
def index():
    return 'Hello World!'
def hellos():
    return dict()
def hellodb(): # NO DAL
    db = sqlite3.connect(os.path.join(request.folder,'databases','hello.db'))
    rows = db.execute('select id, data from hello order by id asc')
    lipsum = [dict(id=row[0], data=row[1]) for row in rows.fetchall()]
    return dict(rows=lipsum)
def hellodb2(): # DAL
    response.view = 'tests/hellodb.html' # recycle view
    db = DAL('sqlite://hello.db')
    db.define_table('hello',Field('data')) # creates table and db if not exists
    rows = db(db.hello).select()
    return dict(rows=rows)
""" > applications/benchmark/controllers/tests.py
mkdir  applications/benchmark/views/tests
echo """
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <title>Hello World</title>
</head>
<body>
    {{ include }}
</body>
</html>
""" > applications/benchmark/views/base.html
echo """
{{ extend "base.html" }}
    <p>Lorem ipsum dolor sit amet, consecteteur adipiscing elit nisi ultricies. Condimentum vel, at augue nibh sed.     Diam praesent metus ut eros, sem penatibus. Pellentesque. Fusce odio posuere litora non integer habitant proin. Metus accumsan nibh facilisis nostra lobortis cum diam tellus. Malesuada nostra a volutpat pede primis congue nisl feugiat in fermentum. Orci in hymenaeos. Eni tempus mi mollis lacinia orci interdum lacus. Sollicitudin aliquet, etiam. Ac. Mi, nullam ligula, tristique penatibus nisi eros nisl pede pharetra congue, aptent nulla, rhoncus tellus morbi, ornare. Magna condimentum erat turpis. Fusce arcu ve suscipit nisi phasellus rutrum a dictumst leo, laoreet dui, ultricies platea. Porta venenatis fringilla vestibulum arcu etiam condimentum non.</p>
""" > applications/benchmark/views/tests/hellos.html
echo """
{{ extend "base.html" }}
<p>Lorem ipsum dolor sit amet, consecteteur adipiscing elit nisi ultricies. Condimentum vel, at augue nibh sed. Diam praesent metus ut eros, sem penatibus. Pellentesque. Fusce odio posuere litora non integer habitant proin. Metus accumsan nibh facilisis nostra lobortis cum diam tellus. Malesuada nostra a volutpat pede primis congue nisl feugiat in fermentum. Orci in hymenaeos. Eni tempus mi mollis lacinia orci interdum lacus. Sollicitudin aliquet, etiam. Ac. Mi, nullam ligula, tristique penatibus nisi eros nisl pede pharetra congue, aptent nulla, rhoncus tellus morbi, ornare. Magna condimentum erat turpis. Fusce arcu ve suscipit nisi phasellus rutrum a dictumst leo, laoreet dui, ultricies platea. Porta venenatis fringilla vestibulum arcu etiam condimentum non.</p>
<table border="1">
    {{ for row in rows }}
        <tr><td>{{=row['id']}}</td><td>{{=row['data']}}</td></tr>
    {{ endfor }}
</table>
""" >  applications/benchmark/views/tests/hellodb.html
python web2py.py -a chooseapassword &
open http://127.0.0.1:8000/benchmark/tests/hello
open http://127.0.0.1:8000/benchmark/tests/hellos
open http://127.0.0.1:8000/benchmark/tests/hellodb
open http://127.0.0.1:8000/benchmark/tests/hellodb2
seedifferently commented 12 years ago

@mdipierro thanks for the code. Could you please comment on web2py's popularity and if there are any high-profile sites build on top of it? The github and google code pages seem to have very few starred/watchers.

mdipierro commented 12 years ago

Hello Seth,

Thanks for your interest.

The github repository is only 3 months old. The main repository is still on googlecode.

You can find some sites built on web2py here:

http://web2py.com/poweredby

web2py is mostly used on intranets. I know some large companies are using it internally but I am not at liberty to say. The google group has 3700 members. You can check the number of messages exchanged on the discussion groups. In 2011 there were more messages exchanged on the web2py googlegroup than on the django googlegroup or the ruby on rails googlegroup.

http://www.infoworld.com/slideshow/24605/infoworlds-2012-technology-of-the-year-award-winners-183313#slide23

massimo

On Feb 23, 2012, at 2:18 AM, Seth Davis wrote:

@mdipierro thanks for the code. Could you please comment on web2py's popularity and if there are any high-profile sites build on top of it? The github and google code pages seem to have very few starred/watchers.

olpe commented 11 years ago

Hi Seth,

Do you have plans to include web2py?

Br, olpe

seedifferently commented 11 years ago

The next update will attempt to move to a more "modular" system allowing you to "plug-in" any test you want into the testing framework. This will hopefully allow me to not have to spend as much time on the project as my schedule has been too busy lately for me to be able to dedicate much time to my F/OSS projects.

olpe commented 11 years ago

Sounds great! When we can expect this to happen?

seedifferently commented 11 years ago

Unfortunately due to my schedule I'm not really sure...sometime this year :-)

olpe commented 11 years ago

Better late than never :)