Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Databases > Re: jTDS, trash...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 8 of 11 Topic 3747 of 3876
Post > Topic >>

Re: jTDS, trashes heap with wrapper cl*****

by Jan Burse <janburse@[EMAIL PROTECTED] > May 13, 2008 at 08:25 PM

Lew schrieb:
> You make it sound so dire.  Allocating these objects takes next to no 
> time, GC will be fast since they'll all be unreachable, and you don't 
> have to worry about it.  Not only that, but Hotspot will probably 
> optimize away the object calls in favor of primitives anyway, possibly 
> enregistered.

The hotspot is not infinitely smart, and alloc/gc is not negliable.
Try the following two codes:

Variant 1:

    Color red=new Color(0xff0000);
    g.setColor(red);
    for (int x=0; x<1000; x++) {
      for (int y=0; y<1000; y++) {
         g.drawRect(x,y,1,1);
      }
    }

Variant 2:

    for (int x=0; x<1000; x++) {
      for (int y=0; y<1000; y++) {
	Color red=new Color(0xff0000);
         g.setColor(red);
         g.drawRect(x,y,1,1);
      }
    }

There is a huge difference between the two
in performance.

Similarly one can waste performance in JDBC
drivers or what ever...

Best Regards
 




 11 Posts in Topic:
jTDS, trashes heap with wrapper classes
Jan Burse <janburse@[E  2008-05-12 17:41:49 
Re: jTDS, trashes heap with wrapper classes
=?ISO-8859-1?Q?Arne_Vajh=  2008-05-12 18:32:28 
Re: jTDS, trashes heap with wrapper classes
Jan Burse <janburse@[E  2008-05-13 02:03:03 
Re: jTDS, trashes heap with wrapper classes
=?ISO-8859-1?Q?Arne_Vajh=  2008-05-12 20:54:40 
Re: jTDS, trashes heap with wrapper classes
Lew <lew@[EMAIL PROTEC  2008-05-12 19:36:38 
Re: jTDS, trashes heap with wrapper classes
Jan Burse <janburse@[E  2008-05-13 02:03:22 
Re: jTDS, trashes heap with wrapper classes
Lew <lew@[EMAIL PROTEC  2008-05-13 00:14:05 
Re: jTDS, trashes heap with wrapper classes
Jan Burse <janburse@[E  2008-05-13 20:25:07 
Re: jTDS, trashes heap with wrapper classes
Lew <lew@[EMAIL PROTEC  2008-05-13 19:28:40 
Re: jTDS, trashes heap with wrapper classes
Jan Burse <janburse@[E  2008-05-14 23:00:42 
Re: jTDS, trashes heap with wrapper classes
Lew <lew@[EMAIL PROTEC  2008-05-14 23:29:16 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Dec 3 21:56:08 CST 2008.