Can deepStrictEqual inside pushDevSchema.ts be swapped for dequal? #12192
Closed
jeepman32
started this conversation in
Feature Requests & Ideas
Replies: 2 comments
-
Draft PR has been created, just in case anyone wanted to see the impacts or test the improvements! I'm currently dogfooding the change, replacing the official |
Beta Was this translation helpful? Give feedback.
0 replies
-
Resolved by dequal replacing assert.deepEqual! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there! Loving Payload CMS so far, but I've hit a big snag.
The
assert.deepStrictEqual
based schema-change detector consumes huge amounts of memory and takes a huge amount of time to complete when facing moderately complex schemas. In my case it consumed 21GB of memory and took 2 minutes 48 seconds to complete.Here is a link to the schema in question. It is fed into the right-hand side of
deepStrictEquals
: My schema.Below is a screenshot of the near-peak memory usage, and a screenshot of the times. The respective method is included before each time to completion.
I did some hacky testing and swapped in
dequal
which completed the check in 1.673s. I also tried outfast-deep-equals
but I founddequal
to be more suitable for the task, and a more suitable replacement.Would a swap from
assert.deepStrictEqual
todequal
or a similar pacakge be an appropriate feature, and a feature that is desired? It appears to be low-hanging fruit that would make Postgres, and possibly SQLite much faster for devs using them!Thanks!
Beta Was this translation helpful? Give feedback.
All reactions