Re: Introspect whether setCharacterEncoding is present..
Nic Ferrier <[email protected]> 12 Oct 2004 16:35:15 +0100
| Newsgroups | gmane.comp.java.advanced-servlets |
|---|---|
| Message-ID | <[email protected]> |
=?iso-8859-1?Q?Endre_St=F8lsvik?= <[email protected]> writes: > | > | - there is a computation cost to throwing them > | Though exceptions are often highly optimized, depsite what some people > | in that google search seem to think. This is because most VMs are > | written in C and an exception can be implemented as a > | longjmp. Certainly, unix longjmp's are very fast. > > longjump or not - that's NOT the question! They have to be allocated, and > -filled in-. That is the problem. Not the control flow as such. Yes... but everything has to be allocated. The jmp_buf in C has to be alloced. There is still a cost in C. Java is about making allocation easier, not more expensive. It's actually de-allocation that costs more than it does in C and the cost is amortized over the life of the VM. > | - there is no other non-local exit feature > | Unlike in C++ which still has longjmp left over from C. > > Use booleans and ifs. Unless it is in a non-critical path, then do > whatever you like. However, in a non-critical path, one may write how bad > code one desires, as it'll execute very seldom. Rubbish. You can't use booleans and ifs to do non-local exits. Sometimes an application has a critical path that requires non-local exits. > The time it takes to =make the Exception=, which wasn't mentioned in your > list! The reason it wasn't in the list is that it's not a factor. All allocation has roughly equal cost. -- Nic Ferrier http://www.tapsellferrier.co.uk ------------------------ Yahoo! Groups Sponsor --------------------~--> $9.95 domain names from Yahoo!. Register anything. http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/saFolB/TM --------------------------------------------------------------------~-> Before posting a question, try to find your answer here: <http://www.egroups.com/links/advanced-servlets> Announcements should go to: [email protected] To Post a message, send it to: [email protected] To Unsubscribe, send a blank message to: [email protected] Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/advanced-servlets/ <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/