Commit 41f5a29
src: speed up process.getActiveResourcesInfo()
This change reduces the number of calls that were crossing the JS-C++
boundary to 1 and also removes the need for calling Array::New()
multiple times internally and ArrayPrototypeConcat-ing the results
later on, thus improving performance.
Refs: #44445 (review)
Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: #46014
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>1 parent 8de6425 commit 41f5a29Copy full SHA for 41f5a29
File tree
Expand file treeCollapse file tree
9 files changed
+103
-50
lines changedOpen diff view settings
Filter options
- benchmark/process
- lib/internal
- bootstrap
- src
Expand file treeCollapse file tree
9 files changed
+103
-50
lines changedOpen diff view settings
Collapse file
benchmark/process/getActiveResourcesInfo.js
Copy file name to clipboard+45Lines changed: 45 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
Collapse file
lib/internal/bootstrap/node.js
Copy file name to clipboardExpand all lines: lib/internal/bootstrap/node.js+1-12Lines changed: 1 addition & 12 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
55 | 55 | |
56 | 56 | |
57 | 57 | |
58 | | - |
59 | | - |
60 | | - |
61 | 58 | |
62 | 59 | |
63 | 60 | |
| ||
192 | 189 | |
193 | 190 | |
194 | 191 | |
195 | | - |
196 | | - |
197 | | - |
198 | | - |
199 | | - |
200 | | - |
201 | | - |
202 | | - |
203 | | - |
| 192 | + |
204 | 193 | |
205 | 194 | |
206 | 195 | |
|
Collapse file
+11-14Lines changed: 11 additions & 14 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
87 | 87 | |
88 | 88 | |
89 | 89 | |
| 90 | + |
90 | 91 | |
91 | 92 | |
92 | 93 | |
| ||
137 | 138 | |
138 | 139 | |
139 | 140 | |
140 | | - |
| 141 | + |
| 142 | + |
| 143 | + |
| 144 | + |
| 145 | + |
141 | 146 | |
142 | 147 | |
143 | 148 | |
| ||
302 | 307 | |
303 | 308 | |
304 | 309 | |
305 | | - |
| 310 | + |
306 | 311 | |
307 | 312 | |
308 | 313 | |
309 | 314 | |
310 | | - |
| 315 | + |
311 | 316 | |
312 | 317 | |
313 | 318 | |
| ||
498 | 503 | |
499 | 504 | |
500 | 505 | |
501 | | - |
| 506 | + |
502 | 507 | |
503 | 508 | |
504 | 509 | |
| ||
544 | 549 | |
545 | 550 | |
546 | 551 | |
547 | | - |
| 552 | + |
548 | 553 | |
549 | 554 | |
550 | 555 | |
| ||
572 | 577 | |
573 | 578 | |
574 | 579 | |
575 | | - |
| 580 | + |
576 | 581 | |
577 | 582 | |
578 | 583 | |
| ||
643 | 648 | |
644 | 649 | |
645 | 650 | |
646 | | - |
647 | | - |
648 | | - |
649 | | - |
650 | | - |
651 | | - |
652 | | - |
653 | 651 | |
654 | 652 | |
655 | 653 | |
| ||
676 | 674 | |
677 | 675 | |
678 | 676 | |
679 | | - |
680 | 677 | |
Collapse file
+4Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
323 | 323 | |
324 | 324 | |
325 | 325 | |
| 326 | + |
| 327 | + |
| 328 | + |
| 329 | + |
326 | 330 | |
327 | 331 | |
328 | 332 | |
|
Collapse file
+4Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
649 | 649 | |
650 | 650 | |
651 | 651 | |
| 652 | + |
652 | 653 | |
653 | 654 | |
654 | 655 | |
| ||
1603 | 1604 | |
1604 | 1605 | |
1605 | 1606 | |
| 1607 | + |
1606 | 1608 | |
1607 | 1609 | |
1608 | 1610 | |
| ||
1649 | 1651 | |
1650 | 1652 | |
1651 | 1653 | |
| 1654 | + |
1652 | 1655 | |
1653 | 1656 | |
1654 | 1657 | |
| ||
1845 | 1848 | |
1846 | 1849 | |
1847 | 1850 | |
| 1851 | + |
1848 | 1852 | |
1849 | 1853 | |
1850 | 1854 | |
|
Collapse file
+3Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
460 | 460 | |
461 | 461 | |
462 | 462 | |
| 463 | + |
463 | 464 | |
464 | 465 | |
465 | 466 | |
| ||
667 | 668 | |
668 | 669 | |
669 | 670 | |
| 671 | + |
670 | 672 | |
671 | 673 | |
672 | 674 | |
| ||
988 | 990 | |
989 | 991 | |
990 | 992 | |
| 993 | + |
991 | 994 | |
992 | 995 | |
993 | 996 | |
|
Collapse file
src/node_process_methods.cc
Copy file name to clipboardExpand all lines: src/node_process_methods.cc+26-24Lines changed: 26 additions & 24 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
258 | 258 | |
259 | 259 | |
260 | 260 | |
261 | | - |
262 | | - |
263 | | - |
264 | | - |
265 | | - |
266 | | - |
267 | | - |
268 | | - |
269 | | - |
270 | | - |
271 | | - |
272 | | - |
273 | | - |
274 | | - |
275 | | - |
276 | 261 | |
277 | 262 | |
278 | 263 | |
| ||
288 | 273 | |
289 | 274 | |
290 | 275 | |
291 | | - |
| 276 | + |
292 | 277 | |
| 278 | + |
| 279 | + |
| 280 | + |
| 281 | + |
| 282 | + |
| 283 | + |
| 284 | + |
| 285 | + |
| 286 | + |
293 | 287 | |
294 | | - |
| 288 | + |
295 | 289 | |
296 | 290 | |
297 | | - |
298 | | - |
| 291 | + |
| 292 | + |
299 | 293 | |
300 | 294 | |
| 295 | + |
| 296 | + |
| 297 | + |
| 298 | + |
| 299 | + |
| 300 | + |
| 301 | + |
| 302 | + |
| 303 | + |
| 304 | + |
301 | 305 | |
302 | | - |
| 306 | + |
303 | 307 | |
304 | 308 | |
305 | 309 | |
| ||
578 | 582 | |
579 | 583 | |
580 | 584 | |
581 | | - |
582 | 585 | |
583 | 586 | |
584 | | - |
| 587 | + |
585 | 588 | |
586 | 589 | |
587 | 590 | |
| ||
609 | 612 | |
610 | 613 | |
611 | 614 | |
612 | | - |
613 | 615 | |
614 | | - |
| 616 | + |
615 | 617 | |
616 | 618 | |
617 | 619 | |
|
Collapse file
+3Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
120 | 120 | |
121 | 121 | |
122 | 122 | |
| 123 | + |
123 | 124 | |
124 | 125 | |
125 | 126 | |
| ||
734 | 735 | |
735 | 736 | |
736 | 737 | |
| 738 | + |
737 | 739 | |
738 | 740 | |
739 | 741 | |
| ||
755 | 757 | |
756 | 758 | |
757 | 759 | |
| 760 | + |
758 | 761 | |
759 | 762 | |
760 | 763 | |
|
Collapse file
+6Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
59 | 59 | |
60 | 60 | |
61 | 61 | |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
62 | 68 | |
63 | 69 | |
64 | 70 | |
|
0 commit comments