[futurebasic] Re: [FB] Slowdown in Leopard?

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 2007 : Group Archive : Group : All Groups

From: Rich Love <richlove@...>
Date: Wed, 14 Nov 2007 07:00:06 -0600
Thanks for the fix.
This speeds up the FB editor again.

Rich


>
> I wrote:
>> A striking feature of the slowdown is that it is progressive. Seems  
>> like (1) something causes cruft to accumulate, and (2) some other  
>> code gets massively slower as a result.
>>
>> The slowed code might be a function like IsHandleValid(), whose  
>> execution time depends on the number of Handle blocks to be searched.
>> IsHandleValid() is in a couple of places in the Appearance runtime,  
>> and in many routines in the editor.
>> The 'sample' tool results posted by John McKernon showed  
>> IsHandleValid in the call stacks.
>
> Steve wrote:
>> I think I recorded where the problem lies using the Instruments  
>> application.
>> 82% of the total calls is coming from IshandleValid
>
> I built an experimental version of the editor with no calls to  
> IsHandleValid, and the slowdown is completely gone. The offender in  
> part (2) above is certainly IsHandleValid.  The offender in part (1)  
> is still unknown.
>
>
> Programmers with apps suffering the 10.5 slowdown should eliminate  
> IsHandleValid as indicated below.
>
> [1] Locate IsWRefConFBHandle (in Rntm Appearance.incl) and change  
> the line:
> #if CarbonLib
> to read:
> #if 0 // [was CarbonLib] don't use slow IsHandleValid
>
> [2] Locate IsCRefConFBHandle (also in Rntm Appearance.incl), and  
> make the same change.
>
> [3] Save Rntm Appearance.incl. If you are unwilling to change the  
> 'official' header file, you could put a copy in User Libraries  
> folder and edit that instead.
>
> [4] Search your project to see if your code uses IsHandleValid.
> If it does, replace every occurrence by a call to MyIsHandleValid:
>
> local fn MyIsHandleValid( h as Handle ) // replacement for slow  
> IsHandleValid
> '~'1
> dim as Boolean valid
> if ( h ) then valid = _true else valid = _false
> end fn = valid
>
>
> This should restore normal speed. The changes do not address the  
> underlying cause, i.e. memory leak or whatever the cruft  
> accumulation really is.
>
> Robert P.
>
> --
> To unsubscribe, send ANY message to: futurebasic-unsubscribe@...
>