Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Performance of null tests?

Reply
Thread Tools

Performance of null tests?

 
 
Adam
Guest
Posts: n/a
 
      11-05-2004
Wow - that's a lot of responses, cheers everyone!

That is what I suspected and our next step will be to evaluate a load
of different points in the code with this in mind. Based on the
likelihood of a null scenario!

Just to give a bit of context, this is part of a server side method
called heavily by a multitude of clients - ergo performance is
paramount, easily readable code can be sacrificied (but mitigated with
verbose comments, one hopes).

And no, I'm not a student
 
Reply With Quote
 
 
 
 
steve
Guest
Posts: n/a
 
      11-06-2004
On Sat, 6 Nov 2004 01:14:02 +0800, Adam wrote
(in article <>) :

> Wow - that's a lot of responses, cheers everyone!
>
> That is what I suspected and our next step will be to evaluate a load
> of different points in the code with this in mind. Based on the
> likelihood of a null scenario!
>
> Just to give a bit of context, this is part of a server side method
> called heavily by a multitude of clients - ergo performance is
> paramount, easily readable code can be sacrificied (but mitigated with
> verbose comments, one hopes).
>
> And no, I'm not a student


For good code design you should not be using exceptions , to do "if",
"while","case" processing.

There is a very good article on the sun java site , called ( i think) "use &
abuse of exceptions"
Your "use" sun classes as serious "abuse", but they also go indepth as to
why you should not do it (giving timings etc. basically when you cause an
exception you are creating an object each time it occurs), and it is very
expensive in time.

Finally if it is server side code ( and considering your user load) ,
consider , the operation of generating thousands of exceptions, both on
memory & time.
Eeeewwwww!!.

steve


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
createImage sometime returns null and sometime returns non-null. vizlab Java 3 10-17-2007 11:21 AM
"stringObj == null" vs "stringObj.equals(null)", for null check?? qazmlp1209@rediffmail.com Java 5 03-29-2006 10:37 PM
difference between null object and null string gokul.b@gmail.com Java 16 10-12-2005 06:43 PM
VB.NET Null to SQL Null (ASP.NET 2.0 GridView) Kivak Wolf ASP .Net 2 06-28-2005 02:01 PM
Is there a null ostream (like /dev/null) in cpp? Bo Peng C++ 13 07-18-2004 07:17 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57