[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A 21st Century Apple II?



apple2freak@gmail.com wrote:
On Mar 5, 3:18 pm, mdj <mdj....@gmail.com> wrote:
On Mar 5, 4:07 pm, apple2fr...@gmail.com wrote:

The reduction in code complexity by using automatic collection however
is a huge benefit to productivity. Consider also that an piece of code
doing it's own collection manually will run more slowly than code that
doesn't, and delegates it to another process that runs in parallel.

There are pros & cons to both ways of doing it.  Since Java doesn't
specify exactly when garbage collection may occur, this can cause
execution delays at inconvenient times -- something easily programmed
around in C++.  Also, as I mentioned earlier, the C++ Boost library
contains a robust garbage collector if that is your thing.

Does Java at least have a way to signal that "now would be a convenient
time to garbage collect"?  That would go a long way toward eliminating
inconvenient pauses.

Also consider the advantages of being able to make optimisation
decisions at runtime vs. compile time. Something your compiler decided
to inline might run beautifully on your machine, but cache-thrash
really badly on your customers smaller system.

This is true in theory; however in practice I have yet to experience
any Java program running more quickly (or with less memory) than an
equivalent C++ program on any platform.

This kind of evaluation is one that needs to be done, just to provide
some objective accountability for the design decision.

I have created lots of examples where dynamic optimization can produce
a considerable advantage.  I know of two actual experiments in which
a machine re-wrote its own object code dynamically based on timer-sample
profile data, and achieved a net improvement of several percent even
*including* the additional overhead of profiling, analysis, and code
re-generation!  These were very simple optimizers with tiny "toolkits"
of patterns.

Of course, the longer the program ran, the less the contribution of the
overhead and the greater the net improvement.

-michael

******** Note new website URL ********

NadaNet and AppleCrate II for Apple II parallel computing!
Home page:  http://home.comcast.net/~mjmahon/

"The wastebasket is our most important design
tool--and it's seriously underused."