Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
0251f5fa
Commit
0251f5fa
authored
Jul 21, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add pypy's (via US) bm_django
parent
3a75208b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
microbenchmarks/bm_django.py
microbenchmarks/bm_django.py
+37
-0
No files found.
microbenchmarks/bm_django.py
0 → 100644
View file @
0251f5fa
"""
This benchmark was adapted from
https://bitbucket.org/pypy/benchmarks/src/34f06618ef7f29d72d9c19f1e3894607587edc76/unladen_swallow/performance/bm_django.py?at=default
"""
__author__
=
"collinwinter@google.com (Collin Winter)"
import
os
import
sys
sys
.
path
.
append
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"../test/integration/django"
))
from
django.conf
import
settings
settings
.
configure
()
from
django.template
import
Context
,
Template
import
time
DJANGO_TMPL
=
Template
(
"""<table>
{% for row in table %}
<tr>{% for col in row %}<td>{{ col|escape }}</td>{% endfor %}</tr>
{% endfor %}
</table>
"""
)
def
test_django
(
count
):
table
=
[
xrange
(
50
)
for
_
in
xrange
(
50
)]
context
=
Context
({
"table"
:
table
})
times
=
[]
for
_
in
xrange
(
count
):
t0
=
time
.
time
()
data
=
DJANGO_TMPL
.
render
(
context
)
t1
=
time
.
time
()
times
.
append
(
t1
-
t0
)
return
times
test_django
(
15
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment