Skip to content

Commit 7915ef8

Browse files
committed
all commands being executed in a pipeline are now executing with a single socket send call. this should increase network throughput
1 parent bd411f9 commit 7915ef8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

redis/client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -946,8 +946,9 @@ def execute_command(self, command_name, command, **options):
946946
return self
947947

948948
def _execute(self, commands):
949-
for name, command, options in commands:
950-
self.connection.send(command, self)
949+
# build up all commands into a single request to increase network perf
950+
all_cmds = ''.join([c for _1, c, _2 in commands])
951+
self.connection.send(all_cmds, self)
951952
# we only care about the last item in the response, which should be
952953
# the EXEC command
953954
for i in range(len(commands)-1):

0 commit comments

Comments
 (0)