[rescue] slow java code...an example of why it might be happening

Patrick Giagnocavo +1.717.201.3366 patrick at zill.net
Tue Feb 11 15:48:06 CST 2003


On Tue, Feb 11, 2003 at 03:50:23PM -0500, Dave McGuire wrote:
> On Tuesday, February 11, 2003, at 03:10 PM, Joshua D. Boyd wrote:
> >>    There's a such thing as a programming language whose conceptual 
> >> level
> >> is TOO HIGH.  This is a big problem with inexperienced programmers.
> >> Most of the horribly slow and bloated C++ code that I've looked 
> >> through
> >> suffers from problems very much like the one I described above, and I
> >> suspect all the commercial farmed-out-to-India bloatware that you guys
> >> are bitching about is like this as well.
> >
> > It's not that the conceptual level is too high.  Writing slow code like
> > you example is just fine, for a prototype.
> 
>    I would *never* write a program that way, even as a prototype.  And 
> neither would you.
> 
--raises hand-

I delivered a custom bit of software to a customer that had the same
flaw you are describing.

I could have speeded it up mightily by taking the data to be converted
and re-arranging it, then using the high-speed copy utility to dump
the data into the db.  Instead, my code painstaking wrapped each
insert inside an SQL transaction.

This was a deliberate decision, since the error checking you get from a
bunch of constraints is very nice, and since the program in question
was a batch one, it didn't matter if a typical run took 15 minutes
instead of 15 seconds.

There were other ways the code could have been speeded up, but
prototype speed was fast enough.


--Patrick


More information about the rescue mailing list