Project

Profile

Help

Bug #4074

closed

Try/Catch overhead because of potential multithreading

Added by Michael Kay over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Multithreading
Sprint/Milestone:
-
Start date:
2018-12-19
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.9
Fix Committed on Branch:
9.9
Fixed in Maintenance Release:
Platforms:

Description

Under Saxon-EE, when try/catch is executed, the xsl:try code prepares for the eventuality that an xsl:result-document instruction will be executed asynchronously during the xsl:try, in which case the xsl:try cannot complete until the xsl:result-document instruction has successfully completed.

This turns out to impose a signficant overhead (about 50ms on the cost of the xsl:try instruction) which can rapidly accumulate if the try/catch encloses only a small amount of code that is frequently executed.

It appears to be possible to avoid this overhead by having the Saxon ThreadManagerEE class create the underlying ExecutorService and CompletionService only when they are first needed, that is, when a result-document instruction is actually executed.

Please register to edit this issue

Also available in: Atom PDF