10 messages in com.mysql.lists.javaRe: mysql strange performance| From | Sent On | Attachments |
|---|---|---|
| Pierre-Etienne Melet | 28 Jul 2004 14:59 | |
| Przemysław Klein | 29 Jul 2004 02:15 | |
| Przemysław Klein | 29 Jul 2004 02:25 | |
| Christian Hammers | 29 Jul 2004 03:16 | |
| Przemysław Klein | 29 Jul 2004 03:21 | |
| Przemysław Klein | 29 Jul 2004 04:03 | |
| Cesar Vega | 29 Jul 2004 05:54 | |
| Mark Matthews | 29 Jul 2004 05:57 | |
| Przemysław Klein | 30 Jul 2004 00:04 | |
| Przemysław Klein | 30 Jul 2004 01:33 |
| Subject: | Re: mysql strange performance![]() |
|---|---|
| From: | Mark Matthews (ma...@mysql.com) |
| Date: | 07/29/2004 05:57:06 AM |
| List: | com.mysql.lists.java |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Przemys?aw Klein wrote:
| Sory, i pointed my last post to wrong place... So once again. | | Hi All. | | I have simple table with 3 fields: fInt int, fDouble double, fText text. | I have 2 methods for retrieving data: | | method1 uses: | rs.getInt("fInt"); | rs.getDouble("fDouble"); | rs.getString("fText"); | | method2 uses: | rs.getInt("fInt"); | Double.parseDouble(rs.getText("fDouble")); | rs.getString("fText");
I imagine you mean rs.getString() here instead of getText()?
In any case, the driver does pretty much the exact same thing you're doing here, so I don't see how it could be 200 times slower:
String s = null;
~ try { ~ s = getString(colIndex);
~ if ((s == null) || (s.length() == 0)) { ~ return 0; ~ }
~ double d = Double.parseDouble(s);
... // code that would only be on if you enabled ~ // 'useStrictFloatingPoint'
return d;
Do you have a profiler handy? I'll test this later today, but I'm almost 100% sure I won't see the same behavior you do (but I'll reserve judgement until testing ;) )
What happens if you flip the order of the method calls around? My hunch is that there's a full GC somewhere during the execution of method2(), which is going to alter your timings quite a bit.
-Mark
- -- Mr. Mark Matthews MySQL AB, Software Development Manager, J2EE and Windows Platforms Office: +1 708 332 0507 www.mysql.com
MySQL Guide to Lower TCO http://www.mysql.com/it-resources/white-papers/tco.php -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFBCPQ4tvXNTca6JD8RAkNvAJwLuwcKcOb9DTmDss7Q+PZy/fwauQCfadQB DZd2yr+fpvEpweAIfNLcw2c= =uLzU -----END PGP SIGNATURE-----




