Commit 5d38e47
authored
chore: optimised isChildPropertyPath to not use a regex and added more logging around calculateSubTreeSortOrder (#41162)
## Description
Reduced the cumulative contribution of isChildPropertyPath by
approximately 98%. During page load, it originally took around 100 ms
for a customer app on a Mac machine and is now down to 2 ms. As a
result, calculateSubTreeSortOrder has improved by 70% on the same setup.
Optimised sorting and removed redundant lookups in addNodes, which led
to marginal gains. This optimisation specifically targets a customer
scenario where addNodes and addDependantsOfNestedPropertyPaths are
heavily stressed, contributing to an overall latency of about 7 seconds.
Added additional logging to investigate the issue further.
Fixes #`Issue Number`
_or_
Fixes `Issue URL`
> [!WARNING]
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._
## Automation
/ok-to-test tags="@tag.All"
### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/16714192460>
> Commit: d6633bb
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=16714192460&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Mon, 04 Aug 2025 05:57:55 UTC
<!-- end of auto-generated comment: Cypress test results -->
## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added a new function to improve detection of child property paths
supporting both dot and bracket notation.
* **Refactor**
* Optimized internal logic for managing dependency sets and improved
node addition efficiency.
* Updated sorting method to accept arrays for better consistency.
* **Style**
* Enhanced code readability and maintainability with more concise
patterns.
* **Chores**
* Introduced performance timing and logging for key operations to aid in
monitoring and diagnostics.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent d0b8899 commit 5d38e47
4 files changed
Lines changed: 100 additions & 28 deletions
File tree
- app/client/src
- ce/workers/Evaluation
- entities/DependencyMap
- utils
- workers/common/DataTreeEvaluator
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
362 | | - | |
| 362 | + | |
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
366 | | - | |
367 | 366 | | |
368 | 367 | | |
369 | 368 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
89 | 90 | | |
| 91 | + | |
| 92 | + | |
90 | 93 | | |
91 | 94 | | |
92 | 95 | | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
97 | 102 | | |
| 103 | + | |
| 104 | + | |
98 | 105 | | |
99 | 106 | | |
100 | 107 | | |
| |||
163 | 170 | | |
164 | 171 | | |
165 | 172 | | |
166 | | - | |
| 173 | + | |
167 | 174 | | |
168 | | - | |
169 | | - | |
| 175 | + | |
170 | 176 | | |
171 | 177 | | |
172 | 178 | | |
| |||
186 | 192 | | |
187 | 193 | | |
188 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
189 | 198 | | |
190 | | - | |
191 | | - | |
| 199 | + | |
| 200 | + | |
192 | 201 | | |
193 | 202 | | |
194 | 203 | | |
195 | 204 | | |
196 | | - | |
197 | | - | |
198 | 205 | | |
199 | 206 | | |
200 | 207 | | |
| |||
228 | 235 | | |
229 | 236 | | |
230 | 237 | | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
235 | 244 | | |
| 245 | + | |
| 246 | + | |
236 | 247 | | |
237 | 248 | | |
238 | 249 | | |
| |||
261 | 272 | | |
262 | 273 | | |
263 | 274 | | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
268 | 280 | | |
| 281 | + | |
| 282 | + | |
269 | 283 | | |
270 | 284 | | |
271 | 285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
302 | 342 | | |
303 | 343 | | |
304 | 344 | | |
| |||
308 | 348 | | |
309 | 349 | | |
310 | 350 | | |
311 | | - | |
312 | | - | |
| 351 | + | |
313 | 352 | | |
314 | 353 | | |
315 | 354 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1958 | 1958 | | |
1959 | 1959 | | |
1960 | 1960 | | |
| 1961 | + | |
| 1962 | + | |
1961 | 1963 | | |
1962 | 1964 | | |
1963 | 1965 | | |
| |||
2005 | 2007 | | |
2006 | 2008 | | |
2007 | 2009 | | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
2008 | 2013 | | |
2009 | 2014 | | |
2010 | 2015 | | |
2011 | 2016 | | |
2012 | 2017 | | |
| 2018 | + | |
2013 | 2019 | | |
2014 | 2020 | | |
2015 | 2021 | | |
2016 | 2022 | | |
2017 | | - | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
2018 | 2026 | | |
2019 | 2027 | | |
2020 | 2028 | | |
2021 | 2029 | | |
| 2030 | + | |
| 2031 | + | |
2022 | 2032 | | |
2023 | 2033 | | |
2024 | 2034 | | |
| 2035 | + | |
2025 | 2036 | | |
2026 | 2037 | | |
2027 | 2038 | | |
2028 | 2039 | | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
2029 | 2049 | | |
2030 | 2050 | | |
2031 | 2051 | | |
| |||
0 commit comments