First post, by Exploit
I have a bunch of Object files for DOS.
They are called:
upcount.obj // counts upwards from 0 to 9 and prints it on the screen
dncount.obj // counts downwards from 9 to 9 and prints each number on the screen
wait.obj // It's delay loop
newline.obj // prints a CRLN
frame.obj // prints an nice frame using upper frame chars of Codepage 437.
https://en.wikipedia.org/wiki/Code_page_437#Character_set
and one main.obj file.
If i create two libraries with the same object files, but in a different order of the object files given to wlib:
wlib lib1.lib +dncount +newline +frame +upcount +wait
wlib lib2.lib +upcount +dncount +wait +newline +frame
And link together an executable with each library:
wlink name prog1 file main lib1.lib
wlink name prog2 file main lib2.lib
Then i get different reproducible runtime speeds for each file:
runtime prog1.exe
Runtime was 4.780220 seconds
runtime prog2.exe
Runtime was 2.472527 seconds
I tried several runs, but prog2 is always faster then prog1 with the time given above.
Even when the lib was created with the same object files.
Why is this so?
Why does creating the lib with a different order of the object file have such a large impact on the runtime speed?
And why doesn't wlib order them automatically in an optimized way?