Re: C++ Speed Vs. Java
Maciej Sobczak wrote:
James Kanze wrote:
VM:
Knowledge of the exact target machine
What's the problem in compiling the C++ program as a set of dynamically
loadable modules (at least for the time-critical parts), each targeted
for different platform, shipping everything together and having the
startup or main program choosing the module to load after inspecting the
actual environment? Or maybe even earlier - at the installation time,
which would allow statically linked modules?
Issues of deployment and disk usage.
Fundamentally, that's more or less what you're already doing if
you support both Sparc and Intel. The problem with taking it
further is that there are (or have been) some twenty or thirty
different variants of each, so you end up with an awful lot of
files to distribute.
It's definitly worth doing, however, in cases where there is one
particular innovation which makes a significant difference.
From what I remember, one of the steps in Oracle installation is to run
the linker on the machine where the software is being installed - that's
a perfect opportunity to select optimal pieces based on the target
environment.
That's possibly a workable solution on platforms where you can
be sure that a linker is always installed. I wouldn't like it,
however; what happens if the linker on the target platform is
not the same version as the one you used to test your code?
Who said that C++ programs must be shipped as single monolithic black
boxes that are always built for the "least common denominator"?
Nobody, but you'll have to admit that it's a lot easier to
deploy a single file than to require some complex installation
procedure.
and better knowledge
of the actual data being processed.
This is a good point and it can be an important factor in those
environment where the statistics of data cannot be foreseen or change
dynamically. The it-depends mantra still holds, though.
Definitly. And I would repeat that in most cases, the
performance issues are secondary to many other issues.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orientie objet/
Beratung in objektorientierter Datenverarbeitung
9 place Simard, 78210 St.-Cyr-l'Icole, France, +33 (0)1 30 23 00 34
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]