gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: corebase: use __builtin___CFStringMakeConstantString when available?


From: Richard Frith-Macdonald
Subject: Re: corebase: use __builtin___CFStringMakeConstantString when available?
Date: Wed, 28 Jun 2017 09:41:01 +0100

> On 28 Jun 2017, at 09:37, David Chisnall <address@hidden> wrote:
> 
> On 28 Jun 2017, at 01:19, Daniel Ferreira (theiostream) <address@hidden> 
> wrote:
>> 
>> That said, I need a way to place a valid Objective-C class definition
>> in that symbol on compile-time (probably it'd be an empty subclass of
>> NSCFString), but I'm totally unaware of any way to do that. Or maybe
>> make that point to an ordinary _OBJC_CLASS_* symbol somehow. Any
>> hints?
> 
> I’m a bit hesitant to suggest this, as it introduces some Objective-C ABI 
> dependency that I’d rather avoid, but you could do this by  creating an alias 
> in the base file that declares the NSConstantString class.
> 
> Slightly longer term, I’d like to move to using a better structure for 
> constant Objective-C strings, with space for unicode flags and a hash (which 
> we’d compute at compile time, with a flag indicating which hashing algorithm 
> we used, so that we could recompute it if GNUstep wants to use a different 
> hash for strings, but have a fast path if the compiler and -base 
> implementations agree).

Yes, storing a hash at compile time would make a substatial difference to 
performance when using literal strings as dictionary keys.  I'd really like 
that.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]