[...]
Quote:> I'm way too busy to waste my time for no reason. Some kind
> soul compiled my program with Digital C and ran it on the Alpha
> 21264. A difference in execution speed comparing to my combo -
> Sun C on UltraSPARC - is more then order of magnitude. Yet I
> spent already quite some time tinkering with various compilation
> options for the SC. As my program in present state isn't that
> complicated and I can't wait days when I know I can get results
> in hours I see the assemler as the only way to go :-(
At the risk of stating the obvious, have you tried profiling your
code to determine where the bottlenecks are? I vaguely recall
something about very large mallocs taking a disproportionately long
time; I *think* it was on Solaris. (Try doing a deja.com search in
comp.unix.solaris, or possibly comp.lang.c{,.moderated}.) If something
like that explains the bulk of the speed difference, optimizing that
one section of code (perhaps by coding it in assembler, perhaps by
choosing a better algorithm) will be a lot easier than rewriting
the whole application. It will also make it a lot easier to port
to other systems, especially if you keep the C implementation as a
portable alternative.
Translating from C to assembler *will* be a waste of time unless you
have good reason to believe you can write better assembler than the
compiler can. It's not as smart as you are, but it's far more patient.
If you've already tried and rejected this, or if this is what you
were talking about in the first place (I missed the original article),
then never mind.
--
San Diego Supercomputer Center <*> <http://www.sdsc.edu/~kst>
"Oh my gosh! You are SO ahead of your time!" -- anon.