Run multiple instances in parallel
I just found and started using the Saxon-JS to be able to run Schematron validations on Peppol (Peppol.eu) messages and it works great! I've "pre-compiled" the Schemat's needed into JSON (using schxslt and xslt3) and I am then executing the SaxonJS.transform() on the data.
As these stylesheets are fairly big it takes some time and performance is of key as it is run through a API.
I run the three calls in a Promise.all() and have added timers. From the timers I can see that the function calls happens in parallel but the execution of SaxonJS.transform() seems to be sequential, i.e. when the first SaxonJS.transform() returns the next starts... Is there some "queuing" or sequential code happening in SaxonJS that would prevent running it in parallel?
Updated by Michael Kay about 2 years ago
I can't think of any obvious problem preventing this, but rather than setting up a test case from scratch and finding that we can't reproduce the problem, it would be great if you could simplify your scenario down to a simple test case that we can execute ourselves to demonstrate the problem (and ideally, add to our test suite).
Updated by Anders Wasen about 2 years ago
Yeah, I actually found the issue while I was putting together the sample code (attached) where I called a function as a constant which blocked the scope it seems...
Moving all code to an anonymous function seems to have done the trick!
I can provide the code anyhow as it might help someone else in the future!
Thanks for the quick response!
Please register to edit this issue