Question

I am currently in the process of building a Finance library for Javascript(Browser and Node)

One of the main features of the library is doing simulations with options, therefore there is a lot of computation that goes into generating the simulations.

I am currently using a library I wrote called AsyncManager which uses HTML5 webworkers(node-webworker) and distributes calculations across a certain number of webworkers. The way I am doing this is by serializing the javascript calculation objects(Calc objects have to implement one method called calculate(args)) including the functions.

(I do the function serialization by changing the functions into the string form of themselves and then I eval them in the webworker to turn them back into functions.)

I was wondering if anyone had thought of a better way to distribute load in javascript using webworkers without knowing the computation ahead of time.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top