www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - slow exceptions

reply Ant <Ant_member pathlink.com> writes:
I've heard people complaining about exception on windows.

here is an exert from the Qu language
http://centrin.net.id/~marc/
(Obviously the guy doesn't speak my native language):
The most noticeable difference is how Qu handle exceptions. Qu appears to be
fast because it does not create exception instances until you explicitly call a
builtin function. When an exception is thrown, it is simply recorded in the
associated Thread object. The idea is that exceptions are (and should be)
extensively used so throwing an exception must be done as fast as possible.

I don't know what he is talking about but if I did it would make sense to me.

Ant
Nov 23 2004
next sibling parent Sean Kelly <sean f4.ca> writes:
In article <co07jc$1ti0$1 digitaldaemon.com>, Ant says...
I've heard people complaining about exception on windows.

The current Win32 exception code sacrifices speed for size, but there's no reason it can't be optimized--it doesn't have to be any slower to throw an exception than it would be unroll the stack normally to the same point. Still, I suspect this sort of performance tuning is low on Walter's list of priorities. There is a bug in this area however (auto class destructors aren't called when they go out of scope from a thrown exception), so perhaps it will get attention sooner than later. Sean
Nov 23 2004
prev sibling parent reply "Walter" <newshound digitalmars.com> writes:
"Ant" <Ant_member pathlink.com> wrote in message
news:co07jc$1ti0$1 digitaldaemon.com...
 I've heard people complaining about exception on windows.

 here is an exert from the Qu language
 http://centrin.net.id/~marc/
 (Obviously the guy doesn't speak my native language):
 The most noticeable difference is how Qu handle exceptions. Qu appears to

 fast because it does not create exception instances until you explicitly

 builtin function. When an exception is thrown, it is simply recorded in

 associated Thread object. The idea is that exceptions are (and should be)
 extensively used so throwing an exception must be done as fast as

Exceptions should be exceptional, not the normal, case, and so if they're slow it should not matter. In any case, D needs to tie into the Windows system exception handling setup, since it is a systems language. That pretty much dictates how it is to be done.
Nov 23 2004
parent reply "Simon Buchan" <currently no.where> writes:
On Tue, 23 Nov 2004 14:43:05 -0800, Walter <newshound digitalmars.com>  
wrote:

 "Ant" <Ant_member pathlink.com> wrote in message
 news:co07jc$1ti0$1 digitaldaemon.com...
 I've heard people complaining about exception on windows.

 here is an exert from the Qu language
 http://centrin.net.id/~marc/
 (Obviously the guy doesn't speak my native language):
 The most noticeable difference is how Qu handle exceptions. Qu appears  
 to

 fast because it does not create exception instances until you explicitly

 builtin function. When an exception is thrown, it is simply recorded in

 associated Thread object. The idea is that exceptions are (and should  
 be)
 extensively used so throwing an exception must be done as fast as

Exceptions should be exceptional, not the normal, case, and so if they're slow it should not matter. In any case, D needs to tie into the Windows system exception handling setup, since it is a systems language. That pretty much dictates how it is to be done.

You mean D uses Windows exception handling on other platforms too? -- Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
Nov 23 2004
parent "Walter" <newshound digitalmars.com> writes:
"Simon Buchan" <currently no.where> wrote in message
news:opshyc13sijccy7t simon.homenet...
 On Tue, 23 Nov 2004 14:43:05 -0800, Walter <newshound digitalmars.com>
 wrote:

 "Ant" <Ant_member pathlink.com> wrote in message
 news:co07jc$1ti0$1 digitaldaemon.com...
 I've heard people complaining about exception on windows.

 here is an exert from the Qu language
 http://centrin.net.id/~marc/
 (Obviously the guy doesn't speak my native language):
 The most noticeable difference is how Qu handle exceptions. Qu appears
 to

 fast because it does not create exception instances until you



 call a
 builtin function. When an exception is thrown, it is simply recorded in

 associated Thread object. The idea is that exceptions are (and should
 be)
 extensively used so throwing an exception must be done as fast as

Exceptions should be exceptional, not the normal, case, and so if


 slow it should not matter. In any case, D needs to tie into the Windows
 system exception handling setup, since it is a systems language. That
 pretty
 much dictates how it is to be done.

You mean D uses Windows exception handling on other platforms too?

No, it uses Windows exception handling on Windows. On Linux, it does something else because there is no OS defined method for doing eh.
Nov 23 2004