Re: Is perl better? :(((
Date: 30 Jan 2005 14:28:16 -0800
Thanks for sharing you experience. I really appreciate it.
Especially these are question which I would ask too.
As you already read I have big experience too.
> Wasthe original PERL script hitting an Oracle database?
Exactly the same.
> Why are you calling thousands of SQL statements that just return a
I hate such design too. Let say in another query from different
database (and different time) we have these pairs.
>Is there any way to call several of these statements in a single call?
No. pairs are different.
> PERL is great for text manipulation, but I don't think this fact
would cover the gammut of ~2.5x
difference in speed.
That was my impression too. Just before yetaerday's night.
> Did you run an explain plan on your Oracle SQL?
I know I can improve this query. But that's not the point. It will be
improved in both languages and it still will be no difference. SQLs are
exactly the same.
Stupid, impractical but the same.
> Is your Oracle box the same DB that the perl scripts are calling? (Ie
production, java hitting some crappy 90mhz oracle box someone threw
Oracle on one box, Java and perl on another. Both production.
> Are you using SQL hints when tuning your SQL?
Yes and no. The same result. See previous answer about SQL.
> When you step through a debug, are the SQL calls taking the most
Don't use debug only start and end time. Code is simple. See my another
answer in the thread.
>Are you using the same Oracle client software on both test scenarios?
> Are you using a persistant connection? (ie not dropping and
reconnecting every script).
Yes. One connection and it's alive for hours. No bad connections or
Results are the same in perl and Java. But perl runs 2.5 faster.
I run two windows on the same Solaris box. In one I run java. In
another in the same time (it's about one hour) I can run perl program
twice for the same result and have another 10-15 minutes for third run.
> Are you creating a Java application for every script, or are you
large single Java app that calls all scripts?
All SQLs are in one thread and in one cycle. One by one. Just like
Of course creating of thousand of threads could be more useful. But
what about poor Oracle? To be honest, our DBAs already called me and
asked to stop my SQL and run in the middle of the night. It was first
call from them in 5 years.
>I don't want the answers to all these, just suggesting some things to
I tried these and a lot of others.
BECAUSE I DON"t WANT TO USE PERL!
I like it too, but support of hundreds of scripts is a nightmare!
And what arguments do I have to switch to Java?
20 minutes vs. hour!
>I know you said you were using the same Oracle, but if all you are
sending a SQL statement to Oracle, Java is done until you get the
doesn't sound the same. By same I mean you are connecting to the same
server, same instance with the same client on the same workstation,
just two different languages.
Don't use threads. As well as perl. See previous answer.
>Does your workstation have enough free memory to be running Java?
This is Solaris with 8Gb. Sure enough to store 1000 keys Hashtable.
>On OraclePower.com (ya ya, shameless plug, but I *do* have a point) I
run 17 queries on the home page, and it comes back instantly. Oracle
hauls-ass with Java.
Sorry, don't understand. A lot of resources. Don't know how they can
help me. Mostly I know all this and always was sure that Oracale loves
Java as well as me. But it doesn't help me to prove my point for
Actually what point? Fact is fact. I can't deny it even I don't like
Maybe it's OCI. But I can't install it on produstion server. I should
use what already exists. So, perl has OCI, JDBC doesn't and perl
Very sad Certified and with huge experience Java programmer