From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Third Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Allow inserting non-BMP characters Date: Tue, 26 Dec 2017 21:36:42 +0000 Message-ID: <20171226213642.GB82103@breton.holly.idiocy.org> References: <20171225210115.13789-1-phst@google.com> <83d132hz9e.fsf@gnu.org> <834lodii55.fsf@gnu.org> <83zi65grxv.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1514324101 23620 195.159.176.226 (26 Dec 2017 21:35:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 26 Dec 2017 21:35:01 +0000 (UTC) User-Agent: Mutt/1.9.1 (2017-09-22) Cc: phst@google.com, Philipp Stephani , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 26 22:34:56 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eTwsA-0005Y8-A5 for ged-emacs-devel@m.gmane.org; Tue, 26 Dec 2017 22:34:54 +0100 Original-Received: from localhost ([::1]:58221 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eTwu7-0007Vw-HA for ged-emacs-devel@m.gmane.org; Tue, 26 Dec 2017 16:36:55 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60531) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eTwu1-0007Vn-Js for emacs-devel@gnu.org; Tue, 26 Dec 2017 16:36:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eTwu0-0003oM-Lv for emacs-devel@gnu.org; Tue, 26 Dec 2017 16:36:49 -0500 Original-Received: from mail-wr0-x233.google.com ([2a00:1450:400c:c0c::233]:33838) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eTwtz-0003lJ-5d; Tue, 26 Dec 2017 16:36:47 -0500 Original-Received: by mail-wr0-x233.google.com with SMTP id 36so2096414wrh.1; Tue, 26 Dec 2017 13:36:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=Jl4Up2xbToMj6nJPd/705Sln5kRc/trpDvxU64ZuTkU=; b=ZqWY9j0U5CnhYuS6Ds3yZLTb+v+NsJmiRdPku0BjKnNiUfwY7SqePW2DY+QvuFMRFk +KGmx2t7LERkCn0d4W3thPl7h0EaxThCMB4Axqus9xiIXlK/yQg2BowxPhTpKFKZbVX8 KXocRC12s29+fjxopTeVqT6KICEnBfog4CV5+MsDTs342+2aysQRYpwHRzrnSyF/II4D hC+XmgLe1mpWdWU0j3jzDO0/2SmnCptm4G/16B4hz2NX7BkF+iIUAz8oGvStdUopZDZU OMdk/bk0K6XtbnmeBL8Vxr1HZMCqLzQFOf6YmqUz2fnSANpR0t/Ef6kxiDmmPDUzl8L7 56kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=Jl4Up2xbToMj6nJPd/705Sln5kRc/trpDvxU64ZuTkU=; b=oQjDrs1srHoOVy6CHUYvodzGPXG+P4Ra7VLuHv37pfGhC7He7qaAUP9LJht9CJNtN7 oYkyq/f/ilXF+Qov96FiRQ92ZK9TZOT6KBWqLIvmfy1U/b2D7c2p56SzH2jB7NHurdeJ ifec2xLPjSFMgxLnih1KMDiH8VWx2lFlSni1IOwPIBu2OO3ClEARMojRIfJk9icmLJZ8 etx9bxkG2rVpnK7zAFJKAymq7FgqG4m3GrMU6mPVYqIJmIylT5NQ0EKGv0/2XuTLIz2+ 1OsBSTJDQzfxJTmr/kCCLA3+v3wqvB1dv5FvmCano2CfxQkbX+p97RRyjJu+0soheMfr 3h+A== X-Gm-Message-State: AKGB3mKDSswvB1sJ+Fs3sNRG88e3+xZKYCcBsUHdaoXY41CMAi3aB5cd 0NbMEHpLqoKjDZ8sKsFYJsDVQoftHUU= X-Google-Smtp-Source: ACJfBovJmhfYwlVfj0FBzRJhAryYG8QVmx60GIbbX8shpctA9de7dZaSs/c3j4rHtNWo8m9WMFi7Sg== X-Received: by 10.223.176.155 with SMTP id i27mr25786019wra.24.1514324205753; Tue, 26 Dec 2017 13:36:45 -0800 (PST) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-e50b-ef10-9192-e044.holly.idiocy.org. [2001:8b0:3f8:8129:e50b:ef10:9192:e044]) by smtp.gmail.com with ESMTPSA id g78sm27149912wmc.30.2017.12.26.13.36.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Dec 2017 13:36:44 -0800 (PST) Content-Disposition: inline In-Reply-To: <83zi65grxv.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::233 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:221428 Archived-At: 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