Commit 1fbd7ac
util: improve inspect's customInspect performance
This improves the performance to copy user options that are then
passed through to the custom inspect function.
The performance improvement depends on the complexity of the custom
inspect function. For very basic cases this is 100% faster than
before.
PR-URL: #30659
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>1 parent d4b41f6 commit 1fbd7acCopy full SHA for 1fbd7ac
File tree
Expand file treeCollapse file tree
2 files changed
+23
-9
lines changedOpen diff view settings
Filter options
- lib/internal/util
- test/parallel
Expand file treeCollapse file tree
2 files changed
+23
-9
lines changedOpen diff view settings
Collapse file
lib/internal/util/inspect.js
Copy file name to clipboardExpand all lines: lib/internal/util/inspect.js+16-7Lines changed: 16 additions & 7 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
121 | 121 | |
122 | 122 | |
123 | 123 | |
| 124 | + |
| 125 | + |
124 | 126 | |
125 | 127 | |
126 | 128 | |
| ||
176 | 178 | |
177 | 179 | |
178 | 180 | |
179 | | - |
180 | | - |
181 | | - |
182 | | - |
183 | | - |
184 | | - |
185 | | - |
| 181 | + |
| 182 | + |
| 183 | + |
| 184 | + |
| 185 | + |
| 186 | + |
| 187 | + |
| 188 | + |
| 189 | + |
| 190 | + |
| 191 | + |
| 192 | + |
| 193 | + |
| 194 | + |
186 | 195 | |
187 | 196 | |
188 | 197 | |
|
Collapse file
test/parallel/test-util-inspect.js
Copy file name to clipboardExpand all lines: test/parallel/test-util-inspect.js+7-2Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
883 | 883 | |
884 | 884 | |
885 | 885 | |
| 886 | + |
| 887 | + |
| 888 | + |
| 889 | + |
886 | 890 | |
887 | 891 | |
888 | 892 | |
| ||
909 | 913 | |
910 | 914 | |
911 | 915 | |
912 | | - |
| 916 | + |
913 | 917 | |
| 918 | + |
914 | 919 | |
915 | | - |
| 920 | + |
916 | 921 | |
917 | 922 | |
918 | 923 | |
|
0 commit comments