From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: string_char_to_byte and string_byte_to_char micro-optimisation Date: Sun, 16 Jun 2019 07:17:01 -0400 Message-ID: References: <83wohovvon.fsf@gnu.org> <83r27vweor.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="264815"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Eli Zaretskii , Emacs developers To: Noam Postavsky Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 16 13:17:19 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hcT9y-0016n5-T3 for ged-emacs-devel@m.gmane.org; Sun, 16 Jun 2019 13:17:19 +0200 Original-Received: from localhost ([::1]:38908 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcT9x-0005KF-Uf for ged-emacs-devel@m.gmane.org; Sun, 16 Jun 2019 07:17:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57811) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hcT9s-0005IT-Md for emacs-devel@gnu.org; Sun, 16 Jun 2019 07:17:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hcT9r-0001J1-PX for emacs-devel@gnu.org; Sun, 16 Jun 2019 07:17:12 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:60007) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hcT9p-0001CT-Lq; Sun, 16 Jun 2019 07:17:09 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id AED3C443957; Sun, 16 Jun 2019 07:17:04 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B1B7C4401CA; Sun, 16 Jun 2019 07:17:03 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1560683823; bh=WmDfVen5kxo+KqFiH8kJsbVUboThaMTSijHHbda9nfc=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=IlIT5OZYBw8IttfZehHzRehCf20Iv559Ty0KfrX+lAInofxCx2V7ibjmSJfwW/Qqe z5kpDt4bA4LvrzWrjtbrt+sXZSmLf8xER/MCg5cTZJU4NdxxC7cOeA7+kED/3a+mPP u5Yvdu/S7cOk+CyV9wsnff5CTbb9ECAR5WVs9rYrAxg3zVZ8iq8a3wN0ONHZ78e8UT XVWKJ3JI3stE58LtP2tEP2ZQUq5+JLK6XmdR/8o/MrfTFHxZjEN+Z7PHTfPTY7iY++ xRtw3KknsZoBehC1J7TxuqSp7PBNJJFCa5R8M3YNCUjkzhL9bSQ8JljSajWd1fLU+l yJ0W1cMmaa8QA== Original-Received: from pastel (unknown [157.52.10.58]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 788D21205FE; Sun, 16 Jun 2019 07:17:03 -0400 (EDT) In-Reply-To: (Noam Postavsky's message of "Sat, 15 Jun 2019 07:11:47 -0400") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:237720 Archived-At: >> be noticeably slowed down by charpos<->bytepos conversion in >> "pathological" cases where we `start` in the middle of a longish string >> and we immediately find a short match. > Would this include cases where you iterate through string-match > results in a loop, incrementing the `start` argument each time, as in > replace-regexp-in-string? Yes, that's exactly the case I had in mind. Stefan