MCPcopy
hub / github.com/redis/redis-py / run

Function run

benchmarks/cluster_async_pipeline.py:31–49  ·  view source on GitHub ↗
(client)

Source from the content-addressed store, hash-verified

29
30@timer
31async def run(client):
32 data_str = "a" * size
33 data_int = int("1" * size)
34
35 for i in range(count):
36 with client.pipeline() as pipe:
37 await (
38 pipe.set(f"bench:str_{i}", data_str)
39 .set(f"bench:int_{i}", data_int)
40 .get(f"bench:str_{i}")
41 .get(f"bench:int_{i}")
42 .hset("bench:hset", str(i), data_str)
43 .hget("bench:hset", str(i))
44 .incr("bench:incr")
45 .lpush("bench:lpush", data_int)
46 .lrange("bench:lpush", 0, 300)
47 .lpop("bench:lpush")
48 .execute()
49 )
50
51
52async def main(loop):

Callers 1

mainFunction · 0.70

Calls 9

lpopMethod · 0.80
lrangeMethod · 0.80
lpushMethod · 0.80
hgetMethod · 0.80
hsetMethod · 0.80
pipelineMethod · 0.45
executeMethod · 0.45
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected