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
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