[PATCH 0/6] newlib/Cygwin: Allow more inlining of locale_t stuff

Corinna Vinschen vinschen@redhat.com
Mon Nov 13 20:02:00 GMT 2017


On Nov 13 16:46, Corinna Vinschen wrote:
> From: Corinna Vinschen <corinna@vinschen.de>
> 
> This patch series exposes most of the locale_t stuff into userspace,
> thus allowing to inline locale and ctype access.
> 
> On Cygwin a speedup can only be accomplished by additionally exposing
> Cygwin's __getreent into userspace and fixing certain, as of yet variable
> aspects of the TLS implementation.
> 
> This code speeds up ctype by roughly 60% on Cygwin.

Please note that I won't push these changes as long as nobody actually
tested this.

The problem on Cygwin is that, whatever we change in locale_t and its
accessor functions, userspace has no access to the address of the _reent
struct within the TLS area yet.  Way back when, it was a conscious
decision not to do this, to keep the TLS area firmly hidden and
changable.

The downside is, userspace always needs at least one function call per
ctype invocation, either the locale_t function to fetch the locale
pointer, or the __getreent function to fetch the reent pointer.
Either way, the timing of a ctype test loop as discussed in
https://sourceware.org/ml/newlib/2017/msg01072.html and follow-ups
stays constant.

Only by exposing the reent pointer offset in the TLS area to
userspace allows to inline the entire code sequence and eventually
speeds up ctype.

Having said that, I'm not overly happy with the Cygwin __getreent
change.  I'm not sure if performance is worth the price here.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20171113/3a7e30d6/attachment.sig>


More information about the Newlib mailing list