Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.databases > #100

Re: jTDS, trashes heap wi

Path csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!novia!news-out.readnews.com!transit3.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail
From "Jan Burse" <jan.burse@THRWHITE.remove-dii-this>
Subject Re: jTDS, trashes heap wi
Message-ID <4829DD03.6010102@fastmail.fm> (permalink)
X-Comment-To Lew
Newsgroups comp.lang.java.databases
In-Reply-To <G5ednQhjJuoQiLTVnZ2dnUVZ_sHinZ2d@comcast.com>
References <G5ednQhjJuoQiLTVnZ2dnUVZ_sHinZ2d@comcast.com>
Content-Type text/plain; charset=IBM437
Content-Transfer-Encoding 8bit
X-Gateway time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92]
Lines 43
Date Wed, 27 Apr 2011 15:21:45 GMT
NNTP-Posting-Host 96.60.20.240
X-Complaints-To news@tds.net
X-Trace newsreading01.news.tds.net 1303917705 96.60.20.240 (Wed, 27 Apr 2011 10:21:45 CDT)
NNTP-Posting-Date Wed, 27 Apr 2011 10:21:45 CDT
Organization TDS.net
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.databases:100

Show key headers only | View raw


  To: Lew
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

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.databases | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

jTDS, trashes heap with w "Jan Burse" <jan.burse@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
  Re: jTDS, trashes heap wi "=?ISO-8859-1?Q?Arne_Vajh=" <=?iso-8859-1?q?arne_vajh=@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
    Re: jTDS, trashes heap wi "Jan Burse" <jan.burse@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
      Re: jTDS, trashes heap wi "=?ISO-8859-1?Q?Arne_Vajh=" <=?iso-8859-1?q?arne_vajh=@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
  Re: jTDS, trashes heap wi "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
    Re: jTDS, trashes heap wi "Jan Burse" <jan.burse@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
      Re: jTDS, trashes heap wi "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
        Re: jTDS, trashes heap wi "Jan Burse" <jan.burse@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
          Re: jTDS, trashes heap wi "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
            Re: jTDS, trashes heap wi "Jan Burse" <jan.burse@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
              Re: jTDS, trashes heap wi "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000

csiph-web