Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
November 23, 2004 slow exceptions | ||||
---|---|---|---|---|
| ||||
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 |
November 23, 2004 Re: slow exceptions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ant | 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 |
November 24, 2004 Re: slow exceptions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ant | "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 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. 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. |
November 24, 2004 Re: slow exceptions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | 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 > 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. > > 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/ |
November 24, 2004 Re: slow exceptions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Simon Buchan | "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 > > 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. > > > > 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? No, it uses Windows exception handling on Windows. On Linux, it does something else because there is no OS defined method for doing eh. |
Copyright © 1999-2021 by the D Language Foundation