Waldek Hebisch wrote:
Peter N Lewis wrote:
One thing that stood out in the profile was that compute_checksum, a two line function that is called once for each loaded gpi is responsible for 12% of the total time. It scans through the entire gpi bytes (in this case, including my GPCMacOSAll 27Meg gpi, once for each of the 250 units in my project), that adds up to around 43 seconds of the 6 minute rebuild time.
<snip>
I did a little test trying also a few other checksums. Remarks:
- loading interfaces should not be a bottleneck, we should be able to compile many modules in a single run, loading interfaces just once in the whole run
The following table is interesting (I can't remember if I posted it before to this list, sorry if I did). I compares compiling the Mac interfaces in two versions: one huge file versus many small units.
(timing in seconds) GPC GP FPC 1 unit with 205000 lines 6 8 8 270 separate units 43 56 13
- I slightly surprised by Mac results: G5 Mac can (and should) use 64-bit arithmetic even for 32-bit applications, also Mac has many registers
Should it use 64-bit integer math instructions, even when -mpowerpc64 is not passed ?
Here are some more results (on a Mac G5 with a single 1.8 GHz PowerPC). I agree that the results are not too good ...
[G5:testgpc/adriaan/c] adriaan% gpcgcc testchecksum2.c -o testchecksum2 [G5:testgpc/adriaan/c] adriaan% ./testchecksum2 sizeof: 8 time= 598382 sum= 46473731586140096 compute_checksum_original time= 590724 sum= 46473731586140096 compute_checksum_short time= 511008 sum= 46473731586140096 compute_checksum_ladd time= 335757 sum= 46473731586140096 compute_checksum_sadd time= 103442 sum= -56390852623264 compute_checksum_lladd time= 611977 sum= 46473731586140096 compute_checksum_unrolled time= 421558 sum= 8551919141529536 compute_checksum_native time= 644395 sum= -2963523148067389 compute_checksum_shift time= 354873 sum= -852473248 compute_checksum_add
[G5:testgpc/adriaan/c] adriaan% gpcgcc testchecksum2.c -o testchecksum2 -O3 [G5:testgpc/adriaan/c] adriaan% ./testchecksum2 sizeof: 8 time= 496856 sum= 46473731586140096 compute_checksum_original time= 117594 sum= 46473731586140096 compute_checksum_short time= 141747 sum= 46473731586140096 compute_checksum_ladd time= 89039 sum= 46473731586140096 compute_checksum_sadd time= 21697 sum= -56390852623264 compute_checksum_lladd time= 221469 sum= 46473731586140096 compute_checksum_unrolled time= 118434 sum= 8551919141529536 compute_checksum_native time= 87099 sum= -2963523148067389 compute_checksum_shift time= 38747 sum= -852473248 compute_checksum_add
[G5:testgpc/adriaan/c] adriaan% gpcgcc testchecksum2.c -o testchecksum2 -O3 -mpowerpc64 [G5:testgpc/adriaan/c] adriaan% ./testchecksum2 sizeof: 8 time= 315570 sum= 46473731586140096 compute_checksum_original time= 201964 sum= 46473731586140096 compute_checksum_short time= 57288 sum= 46473731586140096 compute_checksum_ladd time= 90656 sum= 46473731586140096 compute_checksum_sadd time= 20596 sum= -56390852623264 compute_checksum_lladd time= 113470 sum= 46473731586140096 compute_checksum_unrolled time= 102893 sum= 8551919141529536 compute_checksum_native time= 64930 sum= -2963523148067389 compute_checksum_shift time= 38770 sum= -852473248 compute_checksum_add
Regards,
Adriaan van Os