performance measurements

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

 N  CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
1,0003.323.34108,316322  5% 1% 2% 98%
1,0003.303.33108,328322  6% 1% 1% 99%
1,0003.293.34108,424322  18% 86% 2% 1%

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 3 program source code

import sys
from jinja2 import Template

templ = """

"""


class User(object):
    __slots__ = ('user_id', 'username')

    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 range(n):
        res = render_template(i)

    print(res)

main()

 make, command-line, and program output logs

Thu, 26 Apr 2018 16:46:42 GMT

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

PROGRAM OUTPUT:

<ul>

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

</ul>

Revised BSD license

  Home   Conclusions   License   Play