Commit cdce3b8
authored
fix(shell-api): improve AbstractCursor iteration performance MONGOSH-1688 (#1920)
- Delegate cursor iteration to the driver where possible
- Do not call the wrapped `.tryNext()` method from inside other
shell API methods, and instead only call an internal unwrapped
version of it (similar to `db.runCommand()` vs `db._runCommand()`
This results in a 60% improvement of runtime in local testing on the
`db_cursor_iteration_plainvm` benchmark.1 parent 159a2a9 commit cdce3b8
File tree
4 files changed
+130
-42
lines changed- packages/shell-api/src
4 files changed
+130
-42
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
86 | 90 | | |
87 | 91 | | |
88 | 92 | | |
89 | 93 | | |
90 | 94 | | |
91 | 95 | | |
92 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
93 | 101 | | |
94 | 102 | | |
95 | 103 | | |
96 | 104 | | |
97 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
98 | 114 | | |
99 | 115 | | |
100 | 116 | | |
101 | | - | |
| 117 | + | |
102 | 118 | | |
103 | 119 | | |
104 | 120 | | |
| |||
114 | 130 | | |
115 | 131 | | |
116 | 132 | | |
117 | | - | |
| 133 | + | |
118 | 134 | | |
119 | 135 | | |
120 | 136 | | |
121 | 137 | | |
122 | 138 | | |
123 | 139 | | |
124 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
125 | 150 | | |
126 | 151 | | |
127 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
213 | | - | |
| 212 | + | |
214 | 213 | | |
215 | 214 | | |
216 | 215 | | |
| |||
0 commit comments