Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Saving (and loading) an initialized factory #181

Closed
tinleym opened this issue Dec 23, 2021 · 1 comment
Closed

Saving (and loading) an initialized factory #181

tinleym opened this issue Dec 23, 2021 · 1 comment

Comments

@tinleym
Copy link

tinleym commented Dec 23, 2021

Is there a good way to save an initialized factory to file to load later? I'd like to be able to start up a bigger factory faster.

@kettanaito
Copy link
Member

Hey, @tinleym.

There's no designated API for that. We are implementing what effectively is serialization/deserialization of entities in #87 but I can't give any promises that are going to be a public API you can utilize on your own.

Are you concerned with the runtime or compile-time performance? If it's the former, consider using memorization and other similar tools to reduce the cost of generating a large number of entities. I don't think you can achieve much compile-time performance as the main load happens internally in the library (iteration over model properties, seeding their values, defining the relations).

The most important question I'd ask is: what kind of performance issues you are experiencing? Do you have some metrics to share?

We have some performance tests in the repo and the current benchmark is 1000 entities in ~80ms. It's worth mentioning that the metrics are synthetic and use a rather plain model definition (no relations, for example). That should still be a fairly good default. I'd like to learn more from you about the performance issues you're experiencing.

@mswjs mswjs locked and limited conversation to collaborators Dec 25, 2021
@kettanaito kettanaito converted this issue into discussion #182 Dec 25, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants