Python Interpreters Benchmarks
x64 ArchLinux : AMD® Ryzen 7 4700U®

 performance measurements

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

 N  CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
1,0000.640.6518,396328  2% 2% 2% 0% 3% 0% 100% 2%

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

Read  benchmark to see what this program should do.

 notes

  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(int user_id):
    users = [
        User(user_id, 'SomeUsername')
    ]

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


def main():
    cdef int n

    n = int(sys.argv[1])

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

    print(res)

main()

 make, command-line, and program output logs

 Sun, 23 Apr 2023 09:40:55 GMT

MAKE:
make[1]: Vstupuje se do adresáře „/home/dundee/work/pybenchmarks/bencher/tmp/templates/tmp“
cp templates.cython `echo templates.cython | sed 's/cython-..//' | sed 's/.cython//'`.pyx
cythonize -3 -bi `echo templates.cython | sed 's/cython-..//' | sed 's/.cython//'`.pyx
Compiling /home/dundee/work/pybenchmarks/bencher/tmp/templates/tmp/templates.pyx because it changed.
[1/1] Cythonizing /home/dundee/work/pybenchmarks/bencher/tmp/templates/tmp/templates.pyx
make[1]: Opouští se adresář „/home/dundee/work/pybenchmarks/bencher/tmp/templates/tmp“
1.75s to complete and log all make actions

COMMAND LINE:
 /usr/bin/python3 -c "import templates" 1000

PROGRAM OUTPUT:

<ul>

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

</ul>

Revised BSD license

  Home   Conclusions   License   Play