Beispiel #1
0
async def _parallx():
    """{N} empty jobs with some res, parall"""
    async with open_waitgroup() as wg:
        for _ in range(N):
            wg.submit(Memory(0), nop)
Beispiel #2
0
def test_combine(benchmark, main):
    run(
        partial(_main, main, benchmark),
        config_file=False,
        rpw=Memory(0),
    )
Beispiel #3
0
async def _serialx():
    """{N} empty jobs with some res, serial"""
    for _ in range(N):
        await exec1(Memory(0), nop)
Beispiel #4
0
async def test_head(benchmark):
    async with trio.open_nursery() as _n, \
               GrainExecutor(_n=_n, rpw=Memory(0), config_file=False) as exer:
        await (asyncify(benchmark))(_parallx, exer)
Beispiel #5
0
async def _parallx(exer):
    for _ in range(N):
        exer.submit(Memory(0), nop)
    for _ in range(N):
        await exer.resultq.receive()
Beispiel #6
0
async def _parallx():
    """{N} empty jobs with some res, parall"""
    await each([(nop @ Memory(0))() for _ in range(N)])
Beispiel #7
0
async def _serialx():
    """{N} empty jobs with some res, serial"""
    for _ in range(N):
        await (nop @ Memory(0))()