performance measurements

Each table row shows performance measurements for this PyPy program with a particular command-line input value N.

 N  CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
1,0002.922.9797,920307  14% 39% 15% 75%
1,0003.033.0795,224307  19% 65% 25% 47%
1,0002.942.9797,432307  11% 99% 14% 12%

Read the ↓ make, command line, and program output logs to see how this program was run.

Read templates benchmark to see what this program should do.

 notes

 templates PyPy program source code

import sys
from jinja2 import Template

templ = """

"""


class User(object):
    def __init__(self, user_id, username):
        self.user_id = user_id
        self.username = username


def render_template(user_id):
    users = [
        User(user_id, 'SomeUsername')
    ]

    template = Template(templ)
    return template.render(users=users)


def main():
    n = int(sys.argv[1])

    for i in xrange(n):
        res = render_template(i)

    print res

main()

 make, command-line, and program output logs

Tue, 12 Feb 2019 12:32:43 GMT

COMMAND LINE:
/usr/bin/pypy templates.pypy 1000

PROGRAM OUTPUT:

<ul>

  <li><a href="/user/999">SomeUsername</a></li>

</ul>

Revised BSD license

  Home   Conclusions   License   Play