MCPcopy
hub / github.com/celery/celery / bench_apply

Function bench_apply

t/benchmarks/bench_worker.py:67–72  ·  view source on GitHub ↗
(n=DEFAULT_ITS)

Source from the content-addressed store, hash-verified

65
66
67def bench_apply(n=DEFAULT_ITS):
68 time_start = time.monotonic()
69 task = it._get_current_object()
70 with app.producer_or_acquire() as producer:
71 [task.apply_async((i, n), producer=producer) for i in range(n)]
72 print(f'-- apply {n} tasks: {time.monotonic() - time_start}s')
73
74
75def bench_work(n=DEFAULT_ITS, loglevel='CRITICAL'):

Callers 1

bench_bothFunction · 0.85

Calls 3

producer_or_acquireMethod · 0.80
_get_current_objectMethod · 0.45
apply_asyncMethod · 0.45

Tested by

no test coverage detected