Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poor performance when creating linked entities #274

Open
Shiwa opened this issue May 9, 2023 · 0 comments
Open

Poor performance when creating linked entities #274

Shiwa opened this issue May 9, 2023 · 0 comments

Comments

@Shiwa
Copy link

Shiwa commented May 9, 2023

Hi,

I’ve been trying mswjs/data to mock our APIs and found it quite nice… until I tried with "larger" datasets:

  • one account
  • having a list of 100 clients
  • each client have some invoices, which have some due dates
  • and a few other entities in very small number (<10)

Problem arise when increasing the number of invoices & due dates.
With 1 invoice with 1 due date per client (100 / 100 total), data generation takes ~1s on my laptop (a recent i7-1270P with 32Gb of ram, not filled). Not ideal for automated testing but still manageable.
With 5 invoices (1 due date each) per client (500 / 500 total), data generation takes 34s…
With 5 invoices with 5 due dates each, firefox asks me if I want to go into debug because the page froze.

I ran the profiler and most of the generation time is spent in the "defineRelationalProperties" function :
image

Since invoices are an important entity in our app and we want to test pagination with 100+ items, it’s a blocking problem for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant