✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ beluga.o2switch.net ​🇻​♯➤ 4.18.0-553.123.2.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2026

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 185.154.139.77 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.84
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /opt/alt/python37/share/doc/alt-python37-Cython/Demos/benchmarks//coroutines.py
#!/usr/bin/python3
# cython: language_level=3
# micro benchmarks for coroutines

COUNT = 100000

import cython


async def done(n):
    return n


@cython.locals(N=cython.Py_ssize_t)
async def count_to(N):
    count = 0
    for i in range(N):
        count += await done(i)
    return count


async def await_all(*coroutines):
    count = 0
    for coro in coroutines:
        count += await coro
    return count


@cython.locals(N=cython.Py_ssize_t)
def bm_await_nested(N):
    return await_all(
        count_to(N),
        await_all(
            count_to(N),
            await_all(*[count_to(COUNT // i) for i in range(1, N+1)]),
            count_to(N)),
        count_to(N))


def await_one(coro):
    a = coro.__await__()
    try:
        while True:
            await_one(next(a))
    except StopIteration as exc:
        result = exc.args[0] if exc.args else None
    else:
        result = 0
    return result


def time(fn, *args):
    from time import time
    begin = time()
    result = await_one(fn(*args))
    end = time()
    return result, end-begin


def benchmark(N):
    times = []
    for _ in range(N):
        result, t = time(bm_await_nested, 1000)
        times.append(t)
        assert result == 8221043302, result
    return times


main = benchmark

if __name__ == "__main__":
    import optparse
    parser = optparse.OptionParser(
        usage="%prog [options]",
        description="Micro benchmarks for generators.")

    import util
    util.add_standard_options_to(parser)
    options, args = parser.parse_args()

    util.run_benchmark(options, options.num_runs, benchmark)


Current_dir [ 𝗡𝗢𝗧 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
25 Jul 2024 8.44 AM
root / linksafe
0755
bpnn3.pxd
0.623 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
bpnn3.py
5.23 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
chaos.pxd
0.813 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
chaos.py
9.672 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
coroutines.py
1.573 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
fstrings.py
7.818 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
generators.py
2.032 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
hexiom2.pxd
1.839 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
hexiom2.py
16.734 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
meteor_contest.pxd
0.292 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
meteor_contest.py
4.282 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
nbody.pxd
0.679 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
nbody.py
4.45 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
nqueens.py
2.373 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
richards.pxd
2.368 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
richards.py
10.219 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
setup.py
0.327 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
spectralnorm.pxd
0.407 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
spectralnorm.py
1.587 KB
18 Mar 2018 6.52 PM
root / linksafe
0644
util.py
1.824 KB
18 Mar 2018 6.52 PM
root / linksafe
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF