Commit e451184
haiyang.zhou
perf: batch flush with write() and channelReadComplete()
Change Session.publish() from writeAndFlush() to write(), and add
channelReadComplete() in RespConnectionHandler to flush once after
all messages in a read batch are processed. This reduces the number
of system calls when handling pipelined commands — instead of one
flush per message, a single flush covers the entire batch.
For the async serial execution path (default mode), responses are
written from the scheduler thread after channelReadComplete has
already fired, so processResponse() explicitly calls flush() after
each write to ensure delivery.
A default no-op flush() is added to the Session interface for
backward compatibility with custom implementations.
Made-with: Cursor1 parent 160b490 commit e451184
File tree
4 files changed
+13
-1
lines changed- src/main/java/com/github/tonivade/resp
- command
4 files changed
+13
-1
lines changedLines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
44 | 49 | | |
45 | 50 | | |
46 | 51 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| 143 | + | |
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
| |||
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
40 | 45 | | |
41 | 46 | | |
42 | 47 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
0 commit comments