コード例 #1
0
ファイル: markbench.py プロジェクト: wpjunior/proled
def time_tal(fn, count):
    p = HTMLTALParser()
    p.parseFile(fn)
    program, macros = p.getCode()
    engine = DummyEngine(macros)
    engine.globals = data
    tal = TALInterpreter(program, macros, engine, StringIO(), wrap=0,
                         tal=1, strictinsert=0)
    return time_apply(tal, (), {}, count)
コード例 #2
0
ファイル: markbench.py プロジェクト: wpjunior/proled
def profile_tal(fn, count, profiler):
    p = HTMLTALParser()
    p.parseFile(fn)
    program, macros = p.getCode()
    engine = DummyEngine(macros)
    engine.globals = data
    tal = TALInterpreter(program, macros, engine, StringIO(), wrap=0,
                         tal=1, strictinsert=0)
    for i in range(4):
        tal()
    r = [None] * count
    for i in r:
        profiler.runcall(tal)
コード例 #3
0
ファイル: markbench.py プロジェクト: bendavis78/zope
def time_tal(fn, count):
    p = HTMLTALParser()
    p.parseFile(fn)
    program, macros = p.getCode()
    engine = DummyEngine(macros)
    engine.globals = data
    tal = TALInterpreter(program,
                         macros,
                         engine,
                         StringIO(),
                         wrap=0,
                         tal=1,
                         strictinsert=0)
    return time_apply(tal, (), {}, count)
コード例 #4
0
ファイル: markbench.py プロジェクト: bendavis78/zope
def profile_tal(fn, count, profiler):
    p = HTMLTALParser()
    p.parseFile(fn)
    program, macros = p.getCode()
    engine = DummyEngine(macros)
    engine.globals = data
    tal = TALInterpreter(program,
                         macros,
                         engine,
                         StringIO(),
                         wrap=0,
                         tal=1,
                         strictinsert=0)
    for i in range(4):
        tal()
    r = [None] * count
    for i in r:
        profiler.runcall(tal)