Commit 600478a
dgram: use
This improves dgram performance by avoiding unnecessary async
operations.
One issue with this commit is that it seems hard to actually create
conditions under which the fallback path to the async case is
actually taken, for all supported OS, so an internal CLI option
is used for testing that path.
Another caveat is that the lack of an async operation means
that there are slight timing differences (essentially `nextTick()`
rather than `setImmediate()` for the send callback).
PR-URL: #29832
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>uv_udp_try_send()
1 parent b309e20 commit 600478aCopy full SHA for 600478a
File tree
Expand file treeCollapse file tree
11 files changed
+82
-28
lines changedOpen diff view settings
Filter options
- benchmark/dgram
- lib
- src
- test
- async-hooks
- parallel
- sequential
Expand file treeCollapse file tree
11 files changed
+82
-28
lines changedOpen diff view settings
Collapse file
benchmark/dgram/array-vs-concat.js
Copy file name to clipboardExpand all lines: benchmark/dgram/array-vs-concat.js+14-6Lines changed: 14 additions & 6 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
29 | 29 | |
30 | 30 | |
31 | 31 | |
32 | | - |
33 | | - |
34 | | - |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
35 | 39 | |
36 | 40 | |
37 | 41 | |
38 | 42 | |
39 | 43 | |
40 | | - |
41 | | - |
42 | | - |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
43 | 51 | |
44 | 52 | |
45 | 53 | |
|
Collapse file
benchmark/dgram/multi-buffer.js
Copy file name to clipboardExpand all lines: benchmark/dgram/multi-buffer.js+7-3Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
27 | 27 | |
28 | 28 | |
29 | 29 | |
30 | | - |
31 | | - |
32 | | - |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
33 | 37 | |
34 | 38 | |
35 | 39 | |
|
Collapse file
benchmark/dgram/offset-length.js
Copy file name to clipboardExpand all lines: benchmark/dgram/offset-length.js+7-3Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
23 | 23 | |
24 | 24 | |
25 | 25 | |
26 | | - |
27 | | - |
28 | | - |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
29 | 33 | |
30 | 34 | |
31 | 35 | |
|
Collapse file
benchmark/dgram/single-buffer.js
Copy file name to clipboardExpand all lines: benchmark/dgram/single-buffer.js+7-3Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
23 | 23 | |
24 | 24 | |
25 | 25 | |
26 | | - |
27 | | - |
28 | | - |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
29 | 33 | |
30 | 34 | |
31 | 35 | |
|
Collapse file
+8Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
666 | 666 | |
667 | 667 | |
668 | 668 | |
| 669 | + |
| 670 | + |
| 671 | + |
| 672 | + |
| 673 | + |
| 674 | + |
| 675 | + |
| 676 | + |
669 | 677 | |
670 | 678 | |
671 | 679 | |
|
Collapse file
+2Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
466 | 466 | |
467 | 467 | |
468 | 468 | |
| 469 | + |
| 470 | + |
469 | 471 | |
470 | 472 | |
471 | 473 | |
|
Collapse file
+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
137 | 137 | |
138 | 138 | |
139 | 139 | |
| 140 | + |
140 | 141 | |
141 | 142 | |
142 | 143 | |
|
Collapse file
+33-11Lines changed: 33 additions & 11 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
429 | 429 | |
430 | 430 | |
431 | 431 | |
432 | | - |
433 | | - |
434 | | - |
435 | | - |
436 | | - |
437 | 432 | |
438 | 433 | |
439 | 434 | |
| ||
448 | 443 | |
449 | 444 | |
450 | 445 | |
451 | | - |
452 | | - |
453 | 446 | |
454 | 447 | |
455 | 448 | |
| ||
462 | 455 | |
463 | 456 | |
464 | 457 | |
| 458 | + |
| 459 | + |
| 460 | + |
| 461 | + |
| 462 | + |
| 463 | + |
| 464 | + |
| 465 | + |
| 466 | + |
| 467 | + |
| 468 | + |
| 469 | + |
| 470 | + |
| 471 | + |
| 472 | + |
| 473 | + |
| 474 | + |
| 475 | + |
| 476 | + |
| 477 | + |
| 478 | + |
| 479 | + |
| 480 | + |
| 481 | + |
| 482 | + |
| 483 | + |
465 | 484 | |
| 485 | + |
| 486 | + |
| 487 | + |
| 488 | + |
466 | 489 | |
467 | 490 | |
468 | | - |
| 491 | + |
469 | 492 | |
470 | 493 | |
471 | 494 | |
| 495 | + |
| 496 | + |
472 | 497 | |
473 | 498 | |
474 | | - |
475 | | - |
476 | | - |
477 | 499 | |
478 | 500 | |
479 | 501 | |
|
Collapse file
test/async-hooks/test-udpsendwrap.js
Copy file name to clipboardExpand all lines: test/async-hooks/test-udpsendwrap.js+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
1 | 2 | |
2 | 3 | |
3 | 4 | |
|
Collapse file
test/parallel/test-dgram-send-callback-recursive.js
Copy file name to clipboardExpand all lines: test/parallel/test-dgram-send-callback-recursive.js+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
22 | 22 | |
23 | 23 | |
24 | 24 | |
25 | | - |
| 25 | + |
26 | 26 | |
27 | 27 | |
28 | 28 | |
|
0 commit comments