[PATCH] Speedup gij/libjava loading on darwin

Andreas Tobler toa@pop.agri.ch
Sat Aug 20 18:48:00 GMT 2005


Geoff Keating wrote:
> 
> On 19/08/2005, at 11:48 PM, Andreas Tobler wrote:
> 
>> Geoffrey Keating wrote:
>>
>>> Andrew Pinski <pinskia@physics.uc.edu> writes:
>>>
>>>>     * Makefile.am (extra_ldflags_libjava): New variable to
>>>>     substitute in.
>>>>     (LIBLINK): Add extra_ldflags_libjava to it.
>>>>     * configure.ac (extra_ldflags_libgfortran): Set for *-darwin* to
>>>>     "-Wl,-single_module".
>>>>
>>> This is OK.
>>>
>>
>> I'm not very happy with this patch. I already mentioned it to Andrew.
>> Here on tiger 10.4.2 the situation gets worse. See the figures below.
>> Would you agree to do this change only for darwin7*?
>>
>> Index: configure.ac
>> ===================================================================
>> RCS file: /cvs/gcc/gcc/libjava/configure.ac,v
>> retrieving revision 1.36
>> diff -u -r1.36 configure.ac
>> --- configure.ac        19 Aug 2005 05:14:11 -0000      1.36
>> +++ configure.ac        20 Aug 2005 06:45:40 -0000
>> @@ -670,7 +670,7 @@
>>
>>  # extra LD Flags which are required for targets
>>  case "${host}" in
>> -  *-darwin*)
>> +  *-darwin7*)
>>      # on Darwin -single_module speeds up loading of the dynamic  
>> libraries.
>>      extra_ldflags_libjava=-Wl,-single_module
>>      ;;
>>
>> Afaik, the dyld and co got rewritten in tiger and now we have a  slow 
>> down. Maybe ld needs a rewrite too?
>>
>>
>> Here the figures :)
> 
> 
> That's not supposed to happen!  Yes, this was unexpected, let's go  back 
> to multi-module on darwin8+ at least until we can work out what  the 
> problem is.
> 
> I put your figures into a little table so I could see the pattern.   It 
> looks like this:
> 
>                single  multi  slowdown
> compile.exp    1017     601   69%
> lang.exp       4362    2811   56%
> mauve.exp      8982    5903   52%
> 
> since compile.exp slowed down by a lot and the execute tests not so  
> much, it looks pretty likely that the problem is in ld.  I expect  that 
> dyld is faster, but ld is so much slower that it's completely  hiding 
> the benefit.

On observation, not very precise, but I see the invocation of ld in 'top 
-u' while with multimodule I don't see it.
Viewing the 'tail -f libjava.log' I see a delay in the linking stage 
while the execution stage is ok. Even executing a java gui seems much 
faster than in the 10.3 days. So I'd say dyld got much faster.

> So, the first thing I'll do is reproduce the problem and then file a  
> bug report.

Yes please, it still can be that I have some bad config, I never know. 
Although my tree is pretty clean expect some gui mods which will show up 
in the next classpath merge. But this mods should not affect non gui 
related test cases.

Thanks,
Andreas



More information about the Java-patches mailing list