performance measurements

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

 N  CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
1,0001.091.1219,848322  6% 1% 99% 1%
1,0001.061.0719,664322  10% 100% 3% 3%
1,0001.071.1119,692322  83% 26% 3% 6%

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

Python 3.3.1 (default, Apr 11 2013, 12:45:45)
[GCC 4.7.2] on linux

 templates Python 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

Mon, 12 Nov 2018 12:14:24 GMT

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

PROGRAM OUTPUT:

<ul>

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

</ul>

Revised BSD license

  Home   Conclusions   License   Play