Mail Archives: djgpp/2001/02/07/15:34:21
Hans-Bernhard Broeker wrote:
[snip]
>
> > Do I have to place the function definitions in the same order in one
> > file.c when I compile?
>
> If you want to achieve that sorting: yes. The order of .o files in
> your command line would also be important.
>
> > Is djgpp going to follow that sorting?
>
> Yes. The DJGPP linker doesn't reorder objects itself.
Thanks for the answer and the discussion! very instructive to me.
And that is what I needed to know!. I do not know if this kind of
optimization
is going to be useful in my case. Probably not much, but I got curious when I
changed
in RHIDE the name of one of files in the project and I got ~5% reduction in
the the speed.
I renamed the file to the original and I recovered the speed. Apparently,
RHIDE gives
to the compiler and linker the list of files sorted alphabetically, so
renaming files change the function order. I did not play around much with
this, but it looked weird. That is why I thought
that I could optimize the order of the files and functions. When I have time
I will try a little bit
of this. I won't try to sort the whole thing but I will chose the smallest
and hottest functions
the profiler will give me. I won't be a lot of work, I think.
Of course, I have to do other obvious optimizations first, but since speed is
critical to me, I won't
discard anything...
Thanks,
Miguel
- Raw text -