| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
I ran node_redis benchmark and this patch indeed seems to fix #5095. Full results: https://gist.github.com/aqrln/6fb1af97459e207ec654e75a6fc4cd00 Comparison of benchmarks before and after the patch on a Linux VM: Comparing before, linux-before.txt ( 37 lines) to after, linux-after.txt ( 37 lines) clients: 1: 0 -> 0 ops/sec (∆ - 0 - NaN%) PING: 27089 -> 30315 ops/sec (∆ + 3226 + 11.91%) PING: 618513 -> 668113 ops/sec (∆ + 49600 + 8.02%) SET 4B str: 25407 -> 26432 ops/sec (∆ + 1025 + 4.03%) SET 4B str: 432767 -> 446921 ops/sec (∆ + 14154 + 3.27%) SET 4B buf: 12026 -> 12261 ops/sec (∆ + 235 + 1.95%) SET 4B buf: 17086 -> 171152 ops/sec (∆ + 154066 + 901.71%) GET 4B str: 28040 -> 28977 ops/sec (∆ + 937 + 3.34%) GET 4B str: 507737 -> 525030 ops/sec (∆ + 17293 + 3.41%) GET 4B buf: 23984 -> 27532 ops/sec (∆ + 3548 + 14.79%) GET 4B buf: 454798 -> 523850 ops/sec (∆ + 69052 + 15.18%) SET 4KiB str: 20527 -> 23892 ops/sec (∆ + 3365 + 16.39%) SET 4KiB str: 140304 -> 154618 ops/sec (∆ + 14314 + 10.20%) SET 4KiB buf: 10802 -> 11967 ops/sec (∆ + 1165 + 10.79%) SET 4KiB buf: 15961 -> 129128 ops/sec (∆ + 113167 + 709.02%) GET 4KiB str: 23923 -> 25663 ops/sec (∆ + 1740 + 7.27%) GET 4KiB str: 171351 -> 187105 ops/sec (∆ + 15754 + 9.19%) GET 4KiB buf: 23174 -> 26569 ops/sec (∆ + 3395 + 14.65%) GET 4KiB buf: 144582 -> 163794 ops/sec (∆ + 19212 + 13.29%) INCR: 25148 -> 27120 ops/sec (∆ + 1972 + 7.84%) INCR: 471591 -> 534386 ops/sec (∆ + 62795 + 13.32%) LPUSH: 24301 -> 26746 ops/sec (∆ + 2445 + 10.06%) LPUSH: 383287 -> 441743 ops/sec (∆ + 58456 + 15.25%) LRANGE 10: 23138 -> 25018 ops/sec (∆ + 1880 + 8.13%) LRANGE 10: 204398 -> 236106 ops/sec (∆ + 31708 + 15.51%) LRANGE 100: 15573 -> 17351 ops/sec (∆ + 1778 + 11.42%) LRANGE 100: 33627 -> 37870 ops/sec (∆ + 4243 + 12.62%) SET 4MiB str: 196 -> 215 ops/sec (∆ + 19 + 9.69%) SET 4MiB str: 193 -> 221 ops/sec (∆ + 28 + 14.51%) SET 4MiB buf: 398 -> 461 ops/sec (∆ + 63 + 15.83%) SET 4MiB buf: 415 -> 468 ops/sec (∆ + 53 + 12.77%) GET 4MiB str: 415 -> 466 ops/sec (∆ + 51 + 12.29%) GET 4MiB str: 211 -> 227 ops/sec (∆ + 16 + 7.58%) GET 4MiB buf: 295 -> 321 ops/sec (∆ + 26 + 8.81%) GET 4MiB buf: 296 -> 318 ops/sec (∆ + 22 + 7.43%) : 85250 -> 85161 ops/sec (∆ - 89 - 0.10%) Mean difference in ops/sec: +18075.4 |
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
clever trick!
Sorry, something went wrong.
There was a problem hiding this comment.
I’d find () => startClient(server) a bit easier to read than .bind()
Sorry, something went wrong.
There was a problem hiding this comment.
Can you use assert.strictEqual here?
Sorry, something went wrong.
There was a problem hiding this comment.
Agree, it's better to use strictEqual.
Sorry, something went wrong.
There was a problem hiding this comment.
This doesn’t really need to be wrapped in a function, does it?
Sorry, something went wrong.
There was a problem hiding this comment.
It doesn't. It is only for readability and consistency with startClient.
Sorry, something went wrong.
There was a problem hiding this comment.
...well, at least if this startClient function exists. I'll simplify the code so that it resolves this remark and the one related to bind at once.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM but I’d prefer it if @bnoordhuis or @indutny had a look at it too
Sorry, something went wrong.
There was a problem hiding this comment.
Is this timeout value relevant? Could it be smaller, or maybe even a setImmediate?
Sorry, something went wrong.
There was a problem hiding this comment.
Hmm... maybe it is even better to remove the setTimeout completely since there's a common.mustCall on connection._writev and even 200 ms timeout doesn't guarantee that a client connection would emit two data events if server used write instead of writev.
Sorry, something went wrong.
There was a problem hiding this comment.
So I tested it and yeah, even setTimeout is useless here, not to mention process.nextTick. I'll remove it completely. Though let it be two writes, just in case.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
|
@aqrln you mentioned in IRC that this fixes an issue I self assigned. If that's the case, mind adding the Fixes: field in the commit message? |
Sorry, something went wrong.
|
@trevnorris sure, my bad. I forgot to add it. |
Sorry, something went wrong.
Sorry, something went wrong.
|
@aqrln Sorry for being pedantic but the full URL should be used. not just the issue number. other than that, LGTM |
Sorry, something went wrong.
This commit enables writev for Unix Domain Sockets on supported platforms thus enabling cork/uncork functionality for them and improving IPC performance. Fixes: nodejs#5095
|
@trevnorris thanks for pointing that out, I've updated the commit message. |
Sorry, something went wrong.
|
@jasnell I hope this should be ready to land :) |
Sorry, something went wrong.
Notable changes
* performance: The performance of several APIs has been improved.
- `Buffer.compare()` is up to 35% faster on average. (Brian White)
#10927
- `buffer.toJSON()` is up to 2859% faster on average. (Brian White)
#10895
- `fs.*statSync()` functions are now up to 9.3% faster on average.
(Brian White) #11522
- `os.loadavg` is up to 151% faster. (Brian White)
#11516
- `process.memoryUsage()` is up to 34% faster. (Brian White)
#11497
- `querystring.unescape()` for `Buffer`s is 15% faster on average.
(Brian White) #10837
- `querystring.stringify()` is up to 7.8% faster on average.
(Brian White) #10852
- `querystring.parse()` is up to 21% faster on average. (Brian White)
#10874
* IPC:
- Batched writes have been enabled for process IPC on platforms that
support Unix Domain Sockets. (Alexey Orlenko)
#10677
- Performance gains may be up to 40% for some workloads.
* child_process:
- `spawnSync` now returns a null `status` when child is terminated by
a signal. (cjihrig) #11288
- This fixes the behavior to act like `spawn()` does.
* http:
- Control characters are now always rejected when using
`http.request()`. (Ben Noordhuis)
#8923
- Debug messages have been added for cases when headers contain
invalid values. (Evan Lucas)
#9195
* node:
- Heap statistics now support values larger than 4GB. (Ben Noordhuis)
#10186
* timers:
- Timer callbacks now always maintain order when interacting with
domain error handling. (John Barboza)
#10522
PR-URL: #11759
Notable Changes:
* buffer:
- The performance of `.toJSON()` is now up to 2859% faster on average
(Brian White) #10895
* IPC:
- Batched writes have been enabled for process IPC on platforms that
support Unix Domain Sockets. (Alexey Orlenko)
#10677
- Performance gains may be up to 40% for some workloads.
* http:
- Control characters are now always rejected when using
`http.request()`. (Ben Noordhuis)
#8923
* node:
- Heap statistics now support values larger than 4GB. (Ben Noordhuis)
#10186
Notable Changes:
* buffer:
- The performance of `.toJSON()` is now up to 2859% faster on average
(Brian White) #10895
* IPC:
- Batched writes have been enabled for process IPC on platforms that
support Unix Domain Sockets. (Alexey Orlenko)
#10677
- Performance gains may be up to 40% for some workloads.
* http:
- Control characters are now always rejected when using
`http.request()`. (Ben Noordhuis)
#8923
* node:
- Heap statistics now support values larger than 4GB. (Ben Noordhuis)
#10186
PR-URL: #11760
Notable changes
* performance: The performance of several APIs has been improved.
- `Buffer.compare()` is up to 35% faster on average. (Brian White)
#10927
- `buffer.toJSON()` is up to 2859% faster on average. (Brian White)
#10895
- `fs.*statSync()` functions are now up to 9.3% faster on average.
(Brian White) #11522
- `os.loadavg` is up to 151% faster. (Brian White)
#11516
- `process.memoryUsage()` is up to 34% faster. (Brian White)
#11497
- `querystring.unescape()` for `Buffer`s is 15% faster on average.
(Brian White) #10837
- `querystring.stringify()` is up to 7.8% faster on average.
(Brian White) #10852
- `querystring.parse()` is up to 21% faster on average. (Brian White)
#10874
* IPC:
- Batched writes have been enabled for process IPC on platforms that
support Unix Domain Sockets. (Alexey Orlenko)
#10677
- Performance gains may be up to 40% for some workloads.
* child_process:
- `spawnSync` now returns a null `status` when child is terminated by
a signal. (cjihrig) #11288
- This fixes the behavior to act like `spawn()` does.
* http:
- Control characters are now always rejected when using
`http.request()`. (Ben Noordhuis)
#8923
- Debug messages have been added for cases when headers contain
invalid values. (Evan Lucas)
#9195
* node:
- Heap statistics now support values larger than 4GB. (Ben Noordhuis)
#10186
* timers:
- Timer callbacks now always maintain order when interacting with
domain error handling. (John Barboza)
#10522
PR-URL: #11759
Notable Changes:
* buffer:
- The performance of `.toJSON()` is now up to 2859% faster on average
(Brian White) nodejs/node#10895
* IPC:
- Batched writes have been enabled for process IPC on platforms that
support Unix Domain Sockets. (Alexey Orlenko)
nodejs/node#10677
- Performance gains may be up to 40% for some workloads.
* http:
- Control characters are now always rejected when using
`http.request()`. (Ben Noordhuis)
nodejs/node#8923
* node:
- Heap statistics now support values larger than 4GB. (Ben Noordhuis)
nodejs/node#10186
Signed-off-by: Ilkka Myller <ilkka.myller@nodefield.com>
Notable changes
* performance: The performance of several APIs has been improved.
- `Buffer.compare()` is up to 35% faster on average. (Brian White)
nodejs/node#10927
- `buffer.toJSON()` is up to 2859% faster on average. (Brian White)
nodejs/node#10895
- `fs.*statSync()` functions are now up to 9.3% faster on average.
(Brian White) nodejs/node#11522
- `os.loadavg` is up to 151% faster. (Brian White)
nodejs/node#11516
- `process.memoryUsage()` is up to 34% faster. (Brian White)
nodejs/node#11497
- `querystring.unescape()` for `Buffer`s is 15% faster on average.
(Brian White) nodejs/node#10837
- `querystring.stringify()` is up to 7.8% faster on average.
(Brian White) nodejs/node#10852
- `querystring.parse()` is up to 21% faster on average. (Brian White)
nodejs/node#10874
* IPC:
- Batched writes have been enabled for process IPC on platforms that
support Unix Domain Sockets. (Alexey Orlenko)
nodejs/node#10677
- Performance gains may be up to 40% for some workloads.
* child_process:
- `spawnSync` now returns a null `status` when child is terminated by
a signal. (cjihrig) nodejs/node#11288
- This fixes the behavior to act like `spawn()` does.
* http:
- Control characters are now always rejected when using
`http.request()`. (Ben Noordhuis)
nodejs/node#8923
- Debug messages have been added for cases when headers contain
invalid values. (Evan Lucas)
nodejs/node#9195
* node:
- Heap statistics now support values larger than 4GB. (Ben Noordhuis)
nodejs/node#10186
* timers:
- Timer callbacks now always maintain order when interacting with
domain error handling. (John Barboza)
nodejs/node#10522
PR-URL: nodejs/node#11759
Signed-off-by: Ilkka Myller <ilkka.myller@nodefield.com>
Notable Changes:
* buffer:
- The performance of `.toJSON()` is now up to 2859% faster on average
(Brian White) nodejs/node#10895
* IPC:
- Batched writes have been enabled for process IPC on platforms that
support Unix Domain Sockets. (Alexey Orlenko)
nodejs/node#10677
- Performance gains may be up to 40% for some workloads.
* http:
- Control characters are now always rejected when using
`http.request()`. (Ben Noordhuis)
nodejs/node#8923
* node:
- Heap statistics now support values larger than 4GB. (Ben Noordhuis)
nodejs/node#10186
Signed-off-by: Ilkka Myller <ilkka.myller@nodefield.com>
Notable changes
* performance: The performance of several APIs has been improved.
- `Buffer.compare()` is up to 35% faster on average. (Brian White)
nodejs/node#10927
- `buffer.toJSON()` is up to 2859% faster on average. (Brian White)
nodejs/node#10895
- `fs.*statSync()` functions are now up to 9.3% faster on average.
(Brian White) nodejs/node#11522
- `os.loadavg` is up to 151% faster. (Brian White)
nodejs/node#11516
- `process.memoryUsage()` is up to 34% faster. (Brian White)
nodejs/node#11497
- `querystring.unescape()` for `Buffer`s is 15% faster on average.
(Brian White) nodejs/node#10837
- `querystring.stringify()` is up to 7.8% faster on average.
(Brian White) nodejs/node#10852
- `querystring.parse()` is up to 21% faster on average. (Brian White)
nodejs/node#10874
* IPC:
- Batched writes have been enabled for process IPC on platforms that
support Unix Domain Sockets. (Alexey Orlenko)
nodejs/node#10677
- Performance gains may be up to 40% for some workloads.
* child_process:
- `spawnSync` now returns a null `status` when child is terminated by
a signal. (cjihrig) nodejs/node#11288
- This fixes the behavior to act like `spawn()` does.
* http:
- Control characters are now always rejected when using
`http.request()`. (Ben Noordhuis)
nodejs/node#8923
- Debug messages have been added for cases when headers contain
invalid values. (Evan Lucas)
nodejs/node#9195
* node:
- Heap statistics now support values larger than 4GB. (Ben Noordhuis)
nodejs/node#10186
* timers:
- Timer callbacks now always maintain order when interacting with
domain error handling. (John Barboza)
nodejs/node#10522
PR-URL: nodejs/node#11759
Signed-off-by: Ilkka Myller <ilkka.myller@nodefield.com>
| Back | FazBrowse Home | New Git URL |
This PR enables writev for Unix Domain Sockets on supported platforms thus enabling cork/uncork functionality for them and increasing IPC performance.
Only those Unix-like systems that are confirmed to support the feature (Linux, macOS and FreeBSD) are explicitly listed in the define guard. If anyone has an opportunity to test it under other platforms supported by Node, the list should be expanded, inverted into list of platforms that do not support the feature or even changed to a simple Windows/Unix check.
It should fix #5095 and similar issues, but I haven't benchmarked this specific case and haven't prepared any public benchmarks yet. In my usecase it gives about 1.3–1.4x performance increase on Linux (but strangely the same performance on macOS).
UPD: after discussion on IRC and experiment on CI the patch is enabled on all platforms except Windows.
Checklist
Affected core subsystem(s)
pipe, stream_wrap