Efficient Java Programming

E

EricF

That might be the wrong kind of optimization. Shaving 25 seconds off
individual response times might reduce overall throughput, perhaps reducing
the ability to handle concurrent clients. Often optimization of an enterprise
application requires /increasing/ the response time for individual clients.

That depends on how you do it, but yes, I can see what you're saying. Tuning
an n-tiered system can be quite complex. Luckily I only deal with a subset of
the whole system.

Eric
 
B

bugbear

For instance, if you're
sorting, make sure you use something like quick sort

For most operations (e.g. sorting) use system
or library provided routines. :)

BugBear
 
N

Nigel Wade

Roedy said:
Giving generic advice gets you in trouble.

The OP made a quite general statement - "I definitely feel that my code is quite
inefficient". There was no actual evidence either that their code really was
inefficient or that it would benefit from optimization. It is quite appropriate
to provide generic advice to such a non-specific request.
 
N

Nigel Wade

Lew said:
Classics.

There are two other goals more important than "efficiency" (whatever that is)
or performance, correctness and stability.

By the latter I mean things like getting over errors (or better, not having
them) and handling all inputs without fubaring.

Indeed. I would rather have code which works, and can be understood and
maintained, than code which produces results 10% faster (some of the time).
 
E

Eric Sosman

Nigel said:
Indeed. I would rather have code which works, and can be understood and
maintained, than code which produces results 10% faster (some of the time).

... and yet, there are cases where timeliness can be
more important than accuracy. In a real-time setting, for
example, a rough approximation that is available NOW may be
of some use, while a perfect answer would be worthless a
millisecond later.

In my days doing radar data-processing for air traffic
control, I recall another engineer observing that you can't
radio all the pilots and tell them to hold still while the
computer works through its backlog ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,001
Messages
2,570,254
Members
46,850
Latest member
VMRKlaus8

Latest Threads

Top