bentonam / fakeit

Generates JSON documents based on models defined in YAML and adds them to a Couchbase Bucket
MIT License
86 stars 21 forks source link

Use workers/threads to make it more performant #122

Closed tjbenton closed 6 years ago

tjbenton commented 7 years ago

Would like to use webworkers/threads to make the document generation more performant, currently the only instance that we can get working is threads

The big problem with using either of these methods is that you can't pass in functions to the worker because it converts the passed arguments into JSON so the model functions that are created during the model stage have to be converted back into a string and then when the arguments are passed to the worker they have to be converted back into a function.

also if you set process.env.UV_THREADPOOL_SIZE = 128; it seems to speed up the processing.

If any one is a genius with this feel free to point us in the right direction or take a stab at adding it your self through a PR

tjbenton commented 6 years ago

this is being added in v2