This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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

Attachment: signature.asc
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]