From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.devel Subject: Re: string_char_to_byte and string_byte_to_char micro-optimisation Date: Sat, 15 Jun 2019 07:11:47 -0400 Message-ID: References: <83wohovvon.fsf@gnu.org> <83r27vweor.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="32057"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Eli Zaretskii , Emacs developers To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 15 13:26:55 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 1hc6pj-0008D7-73 for ged-emacs-devel@m.gmane.org; Sat, 15 Jun 2019 13:26:55 +0200 Original-Received: from localhost ([::1]:59880 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hc6pi-0005yu-6S for ged-emacs-devel@m.gmane.org; Sat, 15 Jun 2019 07:26:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50517) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hc6oa-00058p-N9 for emacs-devel@gnu.org; Sat, 15 Jun 2019 07:25:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hc6bR-0008Bv-EH for emacs-devel@gnu.org; Sat, 15 Jun 2019 07:12:11 -0400 Original-Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]:35028) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hc6bN-00082Y-Aj; Sat, 15 Jun 2019 07:12:05 -0400 Original-Received: by mail-oi1-x233.google.com with SMTP id a127so3169263oii.2; Sat, 15 Jun 2019 04:12:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/sGgpf1KkPdKQf5xZfxBrTbp+hhTOzESkQo3cJSApiI=; b=naWZc7LZp+l1XFysI9/5yz6OW32O6UXbZeooGUdyr4TMtfc8o0dw2sMJrx6qQkzsfY TN2FtUb7otjD2wX0deofcSYPLCRMvKq7147pGu4QmuquJwfkhXQfyFdcNOpWdcsBpaB2 dZN7GQ8myQKIp3cTE2iP2wE+FtfMB9xe1jCdSgn+xEXajDAYeHGpJDtYgtLfHvrqHMUi KPiau968XN8zfErq48xGJLq58hcjfRzrYHNtRmK6rVesAgJ/+qRfspN95hRZ9eHu3k2w uvF2jI5Kbx7+iRznrJ/eZvQ13IM46x5JKpGDhgEvulV4CtIDg3btp+fVLHlSIMyMfPds WSjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/sGgpf1KkPdKQf5xZfxBrTbp+hhTOzESkQo3cJSApiI=; b=nh8q4MWnwbUPt/n1BBA5TvlKxWZodxqO5cpvcd5d6rfDVVzLAPgSux5OXbuFTK2law EKoTLOtY08j7vkjN8v1bfJW75LjBGi6VlLCMUWG+v0YccAIm78fUz9+9Zr6UvkGUUQ81 tv5oyeeULtEGZL4BBuY+p3XKoZ/TaMZqz27xRZINZoGuponmjUG0hw+bsKYDmFFG6+ji +Me810WC5Bh08FJ3uNnvIr07ctpPXDZMdBotKKhk8iQJbO1MsBAMb64bfhnPBo5Gsfma jR0C+vDt0qPtoTBI+ZcAzrvHArcDMCxz1QmTOOC1VheNajSwUlVGY2UHVJ0Ay1mi+2pZ IjFA== X-Gm-Message-State: APjAAAUq+pqhZL2hHj4mUgoO59aR2PGIoEGXu6fo3qEmwrfmgOFnUnos BhjpPZrk5ItVzFFjh01+F4qNKXvCkhPyqTWPJEILd2u1 X-Google-Smtp-Source: APXvYqxcXAACKhb2rrVlytGg9hco0jhhS1/fvUVMD5QaDJYTsTgeQVI/Z1dUGGkaq8Q21BJiyW2v2nlVZ/IPnfrNyso= X-Received: by 2002:aca:7203:: with SMTP id p3mr4496576oic.87.1560597123780; Sat, 15 Jun 2019 04:12:03 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::233 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:237666 Archived-At: On Sat, 15 Jun 2019 at 03:49, Stefan Monnier wrote: > 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? (I guess if its REP argument is a function which aref's another multibyte string, then it should miss the cache each time).