kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #30013
Re: LOCALE_IO sucks
-
To:
kicad-developers@xxxxxxxxxxxxxxxxxxx
-
From:
jp charras <jp.charras@xxxxxxxxxx>
-
Date:
Tue, 18 Jul 2017 16:42:28 +0200
-
In-reply-to:
<CAJjCH9qaKgUKD+e10OiTfrKQrGH0EfAxaZ=oD_ndfTC74NL18A@mail.gmail.com>
-
User-agent:
Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Thunderbird/52.2.1
Le 18/07/2017 à 15:47, Chris Pavlina a écrit :
> Yes, the goal would be to try to make the footprint parser entirely non-locale-sensitive so as not
> to need to switch anyway. The problem with LOCALE_IO is that it's incompatible with threading
> (especially on Windows where msys2 provides no concept of a thread-local locale), so there's no way
> to background parsing. I really need to eliminate a GUI freeze on parse, people are not happy with it.
>
> As for removing it entirely from other places too, this may be less feasible. For now I just want it
> out of the footprint parser. Removing it in other places too may have to wait.
LOCALE_IO is used only to allow parsing and conversion (read or write) of float numbers.
So using a custom function to manage float numbers footprint parser is doable.
However I am convinced the freeze time is mainly due to the time to download libs from Github or
access and read the numerous files on a hard disk.
For files on my hard disk I am pretty sure 90% of the time is the time spent to read the files and
10% (and certainly less) is the parsing time.
Why I am thinking that ?
because (test made with 30 libraries, with one lib having 1000 .kicad_mod files) when I am using the
same libraries stored on a SSD, the freeze time is 10% of the freeze time when using these libraries
stored on a hard drive (the noise created by reading hundred or thousand of files lead me to think
this time is mainly spent to move the heads of the hard drive).
Having said that, removing the need to switch current locale to "C" locale to read libraries is
certainly a good thing.
>
> On Jul 18, 2017 7:12 AM, "Wayne Stambaugh" <stambaughw@xxxxxxxxx <mailto:stambaughw@xxxxxxxxx>> wrote:
>
> I have no objections as long as nothing gets broken and the code doesn't
> get more complicated (less readable). LOCALE_IO exists in all of the
> plugins not just the kicad plugin so there is a lot of code to fix. The
> reason LOCALE_IO exists is to hide resetting the locale on exceptions.
> I don't see how any other solution is going to result in cleaner code
> but I'm willing to entertain the idea. Please test your changes
> thoroughly and submit a patch so we can test it and take a look at it
> before committing.
>
> On 7/17/2017 8:44 PM, Chris Pavlina wrote:
> > If I somehow found the time to strip LOCALE_IO completely out of the
> > footprint parser without changing the behavior, would anyone have any
> > religious objections or otherwise mourn the loss?
> >
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers <https://launchpad.net/%7Ekicad-developers>
> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
> Unsubscribe : https://launchpad.net/~kicad-developers <https://launchpad.net/%7Ekicad-developers>
> More help : https://help.launchpad.net/ListHelp <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
>
--
Jean-Pierre CHARRAS
Follow ups
References