Hi Giuseppe,
as long as the files are not on physically different disks, you will have the two functions block each other with read and write operations. And BaseX runs lots of code in parallel without you explicitly telling it so.
Best regards,
Markus
Am 08.12.2019 um 16:48 schrieb celano@informatik.uni-leipzig.de:
Hi,
I am trying to run two BaseX scripts in parallel using:
xquery:fork-join( ( function() {xquery:eval(xs:anyURI('extract_from_ocr1.xq'))} , function (){xquery:eval(xs:anyURI('extract_from_ocr2.xq'))} ) )
As far as I can understand (read below), the scripts are kind of run in parallel, but still the time benefit of that does not seem much in comparison with running in sequence (~25s vs ~28s). The files contain the same function, which reads files from a directory, performs some calculation, and saves the result in a file (the two scripts work on different directories). I infer that the previous script is run in parallel because the files for the results are created at the same time.
I tried to do the same with GNU parallel, and in that case the files are actually run in parallel.
Do we know why the execution time is not (more or less) halved in BaseX? Thanks.
Ciao, Giuseppe