← Back to team overview

kicad-developers team mailing list archive

Re: Loading symbol libraries

 

Hey Jeff,

I merged your patch.  Keep up the great work.

Cheers,

Wayne

On 01/25/2018 06:54 PM, Jeff Young wrote:
> Hi JP, /et al/,
> 
> Please find V2 of the Edit Symbol in Library performance patch attached.
> 
> Cheers,
> Jeff.
> 
> 
> 
> 
> 
>> On 25 Jan 2018, at 16:30, jp charras <jp.charras@xxxxxxxxxx
>> <mailto:jp.charras@xxxxxxxxxx>> wrote:
>>
>> Le 25/01/2018 à 17:15, Jeff Young a écrit :
>>> Hi JP,
>>>
>>> The statics are in the constructors, so they shouldn’t be initialised
>>> until the constructors are
>>> called.  That would be after the dictionary was loaded, wouldn’t it?
>>
>> Yes, you are right.
>>
>>>
>>> But that's moot as I didn’t realise we allow changing the language
>>> while running.
>>
>> Some users change the language while running (like me, and perhaps
>> some other translators).
>>
>> We already have a few bug reports about some strings not correctly
>> translated after a language change.
>> The only one way to fix that is to avoid static wxStrings when they
>> must be translated,
>> an this is not always easy.
>>
>>>
>>> Your pure virtual idea sounds better.
>>>
>>> Cheers,
>>> Jeff.
>>>
>>>
>>>
>>>> On 25 Jan 2018, at 16:06, jp charras <jp.charras@xxxxxxxxxx
>>>> <mailto:jp.charras@xxxxxxxxxx> <mailto:jp.charras@xxxxxxxxxx>> wrote:
>>>>
>>>> Le 25/01/2018 à 16:24, Jeff Young a écrit :
>>>>> More performance enhancements:
>>>>>
>>>>> 1) Edit Symbol gets similar fix as Place Symbol
>>>>> 2) progress-dialog-updating reduced to once every 50ms
>>>>> 3) SearchText gets lazy normalization
>>>>> 4) translation of typeNames and default fieldNames reduced to a
>>>>> single time
>>>>>
>>>>> These fixes speed first-load-time of both Edit Symbol and Place
>>>>> Symbol by a factor of 3, and
>>>>> second-load-time of Edit Symbol to near-instantaneous.
>>>>>
>>>>> Cheers,
>>>>> Jeff.
>>>>>
>>>>>
>>>>
>>>> Hi Jeff,
>>>>
>>>> Are you sure
>>>> static wxString namePrefix = _( "Unit" );
>>>> works when Eeschema is run in stand alone ?
>>>>
>>>> The translation of strings works only after the dictionary is loaded.
>>>> This is not always the case of static wxStrings.
>>>>
>>>> If Eeschema is run from Kicad, the dictionary is loaded but I am not
>>>> sure this is the case in stand
>>>> alone mode.
>>>> And if the language is modified, the translation of static strings
>>>> is not updated.
>>>>
>>>> This is especially true if strings are displayed in the User Interface.
>>>>
>>>> Perhaps a better fix could be:
>>>> - remove m_typeName, if not used in other place than GetTypeName()
>>>> - make LIB_ITEM::GetTypeName() virtual (perhaps virtual pure) and
>>>> the virtual GetTypeName() of each
>>>> class returns the translated name when needed in UI messages
>>>> (returns _( "Arc" ) instead of typeName
>>>> for a LIB_ARC for instance).
>>>> (note: from the point of view of translations, the current code:
>>>> m_typeName = _( "Arc" ); in the ctor
>>>> and the accessor
>>>> wxString GetTypeName() { return m_typeName; }
>>>> is already not good: any translated string should by built on the
>>>> fly when possible)
>>>>
>>>> Thanks.
>>>>
>>>> -- 
>>>> Jean-Pierre CHARRAS
>>
>>
>> -- 
>> Jean-Pierre CHARRAS
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>> <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help   : https://help.launchpad.net/ListHelp
> 
> 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 


References