Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Performance / February 2004

Tip: Looking for answers? Try searching our database.

Abysmal performance of throw/catch in VB.NET

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Danhi - 08 Feb 2004 01:51 GMT
Running on a fast machine, if I issue a throw of a user defined exception, it's 6 seconds before the catch in the calling code is called.  I wrote an app with nothing but a throw/catch to make sure it wasn't some other problem.  This can't be normal.  Is there something I'm missing

Dan
Martin Maat [EBL] - 08 Feb 2004 10:49 GMT
> Running on a fast machine, if I issue a throw of a user defined exception, it's 6 seconds before the catch in the calling code is called.  I wrote an
app with nothing but a throw/catch to make sure it wasn't some other
problem.  This can't be normal.  Is there something I'm missing?

Try to change the code so that it will not throw the exception the first
time it passes. Then re-invoke and measure. What probably happens is that
you are measuring a lot of start-ups, JIT compilation and initialisation
time along with your test case.

Martin.
Miha Markic [MVP C#] - 08 Feb 2004 12:16 GMT
Hi,

Are you running under VS.NET?

Signature

Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

> Running on a fast machine, if I issue a throw of a user defined exception, it's 6 seconds before the catch in the calling code is called.  I wrote an
app with nothing but a throw/catch to make sure it wasn't some other
problem.  This can't be normal.  Is there something I'm missing?

> Dan
Jon Skeet [C# MVP] - 09 Feb 2004 10:09 GMT
> Running on a fast machine, if I issue a throw of a user defined
> exception, it's 6 seconds before the catch in the calling code is
> called. I wrote an app with nothing but a throw/catch to make sure it
> wasn't some other problem. This can't be normal. Is there something
> I'm missing?

My guess is that you're throwing an instance of ApplicationException
(or a derived class). For some reason, the first time that happens it
*does* seem to take a long time (sometimes - I now can't reproduce it
easily). I suspect it's loading some resources (e.g. error message
translation) into memory.

Signature

Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.