fn:error() -> exception?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

fn:error() -> exception?

max toro q
Does Saxon implement fn:error() by throwing a Java exception? I ask
because there's an overhead associated in throwing/catching
exceptions.
--
Max Toro

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: fn:error() -> exception?

Michael Kay
Yes, any dynamic error as defined in XPath is likely to involve a Java exception in its implementation - except possibly in streaming mode, where we push errors up the processing pipeline.

We try hard to avoid using exceptions in non-error cases, e.g. when implementing "castable", though we don't always succeed there because things like NumberFormatException are too convenient and there's no way of getting the equivalent information from the JDK without an exception.

I suspect though that in most cases the costs of the exception (I believe the costs are actually in creating the exception object, not in throwing it) are swamped by other costs.

Michael Kay
Saxonica
[hidden email]
+44 (0) 118 946 5893




On 28 Feb 2015, at 00:11, Max Toro <[hidden email]> wrote:

> Does Saxon implement fn:error() by throwing a Java exception? I ask
> because there's an overhead associated in throwing/catching
> exceptions.
> --
> Max Toro
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website, sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for all
> things parallel software development, from weekly thought leadership blogs to
> news, videos, case studies, tutorials and more. Take a look and join the
> conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help 


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help