performance measurements

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

 N  CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
1,0001.161.1619,952328  9% 15% 15% 100%
1,0001.111.1219,920328  100% 6% 8% 10%
1,0001.161.1819,924328  9% 13% 13% 100%

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 Cython 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(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

Mon, 15 Oct 2018 12:17:06 GMT

MAKE:
make[1]: Vstupuje se do adresáře „/home/dundee/workspace/benchmarksgame/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/workspace/benchmarksgame/bencher/tmp/templates/tmp/templates.pyx because it changed.
[1/1] Cythonizing /home/dundee/workspace/benchmarksgame/bencher/tmp/templates/tmp/templates.pyx
running build_ext
building 'templates' extension
creating /home/dundee/workspace/benchmarksgame/bencher/tmp/templates/tmp/tmpdj2nlbld/home
creating /home/dundee/workspace/benchmarksgame/bencher/tmp/templates/tmp/tmpdj2nlbld/home/dundee
creating /home/dundee/workspace/benchmarksgame/bencher/tmp/templates/tmp/tmpdj2nlbld/home/dundee/workspace
creating /home/dundee/workspace/benchmarksgame/bencher/tmp/templates/tmp/tmpdj2nlbld/home/dundee/workspace/benchmarksgame
creating /home/dundee/workspace/benchmarksgame/bencher/tmp/templates/tmp/tmpdj2nlbld/home/dundee/workspace/benchmarksgame/bencher
creating /home/dundee/workspace/benchmarksgame/bencher/tmp/templates/tmp/tmpdj2nlbld/home/dundee/workspace/benchmarksgame/bencher/tmp
creating /home/dundee/workspace/benchmarksgame/bencher/tmp/templates/tmp/tmpdj2nlbld/home/dundee/workspace/benchmarksgame/bencher/tmp/templates
creating /home/dundee/workspace/benchmarksgame/bencher/tmp/templates/tmp/tmpdj2nlbld/home/dundee/workspace/benchmarksgame/bencher/tmp/templates/tmp
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong -fno-plt -flto=4 -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong -fno-plt -fPIC -I/usr/include/python3.7m -c /home/dundee/workspace/benchmarksgame/bencher/tmp/templates/tmp/templates.c -o /home/dundee/workspace/benchmarksgame/bencher/tmp/templates/tmp/tmpdj2nlbld/home/dundee/workspace/benchmarksgame/bencher/tmp/templates/tmp/templates.o
gcc -pthread -shared -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=4 -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now /home/dundee/workspace/benchmarksgame/bencher/tmp/templates/tmp/tmpdj2nlbld/home/dundee/workspace/benchmarksgame/bencher/tmp/templates/tmp/templates.o -L/usr/lib -lpython3.7m -o /home/dundee/workspace/benchmarksgame/bencher/tmp/templates/tmp/templates.cpython-37m-x86_64-linux-gnu.so
make[1]: Opouští se adresář „/home/dundee/workspace/benchmarksgame/bencher/tmp/templates/tmp“
2.30s 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