emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Allow inserting non-BMP characters


From: Alan Third
Subject: Re: [PATCH] Allow inserting non-BMP characters
Date: Tue, 26 Dec 2017 21:36:42 +0000
User-agent: Mutt/1.9.1 (2017-09-22)

On Tue, Dec 26, 2017 at 10:22:36PM +0200, Eli Zaretskii wrote:
> > Message (method) invocations in Objective-C have high overhead because they 
> > are late-bound. Therefore it is
> > advisable to minimize the number of messages sent.
> > https://developer.apple.com/documentation/foundation/nsstring/1408720-getcharacters?language=objc
> >  also
> > indicates that a (properly implemented) getCharacters call is faster than 
> > calling characterAtIndex in a loop.
> 
> Is that a fact, or should we measure that?

Appleā€™s documentation says to put it in a buffer:

    If you want to iterate over the characters of a string, one of the
    things you should not do is use the characterAtIndex: method to
    retrieve each character separately. This method is not designed for
    repeated access. Instead, consider fetching the characters all at once
    using the getCharacters:range: method and iterating over the bytes
    directly.

    
https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CocoaPerformance/Articles/StringDrawing.html#//apple_ref/doc/uid/TP40001445-112378

-- 
Alan Third



reply via email to

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