From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.devel Subject: =?UTF-8?Q?Re=3A_=5BEmacs=2Ddiffs=5D_master_c66aaa6=3A_Recomplexify_=E2=80=98de?= =?UTF-8?Q?lete=2Dtrailing=2Dwhitespace=E2=80=99_by_treating_=5Cn_as_whitespace_aga?= =?UTF-8?Q?in?= Date: Wed, 15 Mar 2017 23:04:38 -0400 Message-ID: References: <20170315023157.29463.36647@vcs0.savannah.gnu.org> <20170315023159.30AA520CAB@vcs0.savannah.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=f4030435d0d85a0d99054ad0528a X-Trace: blaine.gmane.org 1489633488 24802 195.159.176.226 (16 Mar 2017 03:04:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 16 Mar 2017 03:04:48 +0000 (UTC) Cc: Emacs developers To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 16 04:04:44 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 1coLiS-0005aP-6b for ged-emacs-devel@m.gmane.org; Thu, 16 Mar 2017 04:04:40 +0100 Original-Received: from localhost ([::1]:40579 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1coLiY-0008BG-8w for ged-emacs-devel@m.gmane.org; Wed, 15 Mar 2017 23:04:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1coLiS-0008BB-Lq for emacs-devel@gnu.org; Wed, 15 Mar 2017 23:04:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1coLiR-0005Cn-M9 for emacs-devel@gnu.org; Wed, 15 Mar 2017 23:04:40 -0400 Original-Received: from mail-ot0-x22a.google.com ([2607:f8b0:4003:c0f::22a]:34939) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1coLiR-0005Cf-Hj for emacs-devel@gnu.org; Wed, 15 Mar 2017 23:04:39 -0400 Original-Received: by mail-ot0-x22a.google.com with SMTP id x37so41162201ota.2 for ; Wed, 15 Mar 2017 20:04:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=+rOprVYLjEF8xAIQJoow3j50f9V8D9cnvi3Vk+wbcyU=; b=qbZ65WPCHH1xktQtL78n3bzpQLn9lbh9mGzwgzr8AznvCya8ifpWic0GJKMiG846ku vHH1X98N984x+DoD6GlkaiaywsziIIvRGr+mPqZrdFD2K470F4fM/4CP2SDV/XtwFJjC 7EroInSHpfJlk0g6TMHZFK6CfnT+6DSx5yc7PzL6PsRn9fWP4O7ujEA5y3d4GL3xdeSP dSoW3ozyl9Ja9gaa1ulGxwyB0+tebpoWAEvgY1c8zPYUftVXd2huxnGZb2BzRb0N1lVI O0CcSLD/4agllhK+/hoeR6Eda9KpZgn/GS5wcKFGp3DoTTziddddtmVqToGzCs2fgN5i OXUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=+rOprVYLjEF8xAIQJoow3j50f9V8D9cnvi3Vk+wbcyU=; b=KOzjWbawFGSX2qdjeuWV6F64GsP8fE1LeVHQ/eQPzsEWxLZ7Ym2o29SpHa77HNpACR XTa6Ef/wn/kuNw0Q6NlFnbRGSO7LMcvBh/OKWVogl7EtYrqHdoNbPrbVBBHwUPvns8y6 3vy2yZdft9wZomFFo6KYwNNEzYMbcKzjJoEa664lQVkM0llCnS6iNuo2dnzjvHZTctgm 2272cWsYBDNYca/vzmUGAQjAk8mrtiuDXsAT1gVHHSXNBSKYILgPrZgfHiRHAvM34WiL asxnW5SIYV5cCX6QfHNIJXJcNA4HLsCYK8wnFRjjhySaUD80P4TLC4jOgadZxlMva28G G9bw== X-Gm-Message-State: AFeK/H0I6x4Yb9GXv6h4cziRQXAMc0gCeS/Oi0uD25UQ+vNN7bjobikxG7cFEmIvJL3do3zrcdlQAj59ejW2Qw== X-Received: by 10.157.68.163 with SMTP id v35mr3217062ote.55.1489633478819; Wed, 15 Mar 2017 20:04:38 -0700 (PDT) Original-Received: by 10.157.80.172 with HTTP; Wed, 15 Mar 2017 20:04:38 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: 8YCkDsdLR0RgF8L0itPdNzw7l8Y X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c0f::22a 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:213068 Archived-At: --f4030435d0d85a0d99054ad0528a Content-Type: text/plain; charset=UTF-8 On Wed, Mar 15, 2017 at 10:52 PM, Stefan Monnier wrote: > Yes, it's normal: the "search" attempts a "match" from every whitespace. > So if you have N consecutive whitespace chars in the middle of line, > that gives you N attempts to "match" and every attempt takes O(N) steps > to find that the end of the whitespace is not an LF. > > I don't understand how "\\s-+$" can be significantly faster than > "[\s\t]+$" in this respect. What? I though I said "\\s-+" is *slower* (though only by a factor of 2). Anyway, how about the attached which removes the syntax table stuff. --f4030435d0d85a0d99054ad0528a Content-Type: text/x-patch; charset=US-ASCII; name="0001-Simplify-delete-trailing-whitespace-by-dropping-synt.patch" Content-Disposition: attachment; filename="0001-Simplify-delete-trailing-whitespace-by-dropping-synt.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_j0btb77e0 RnJvbSAyMjc1NDg3MjMyYjk2Y2E3ODJjYTY3MWQ2MGJlMDAyZTM5NDhhNzY0IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBOb2FtIFBvc3RhdnNreSA8bnBvc3RhdnNAZ21haWwuY29tPgpE YXRlOiBXZWQsIDE1IE1hciAyMDE3IDIzOjAxOjEzIC0wNDAwClN1YmplY3Q6IFtQQVRDSF0gU2lt cGxpZnkgZGVsZXRlLXRyYWlsaW5nLXdoaXRlc3BhY2UgYnkgZHJvcHBpbmcgc3ludGF4IHRhYmxl cwoKKiBsaXNwL3NpbXBsZS5lbCAoZGVsZXRlLXRyYWlsaW5nLXdoaXRlc3BhY2UpOiBKdXN0IG1h dGNoIFtbOmJsYW5rOl1dCmluZGVwZW5kZW50bHkgb2YgY3VycmVudCBzeW50YXggdGFibGUuCi0t LQogbGlzcC9zaW1wbGUuZWwgfCAxNSArKysrKysrLS0tLS0tLS0KIDEgZmlsZSBjaGFuZ2VkLCA3 IGluc2VydGlvbnMoKyksIDggZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvbGlzcC9zaW1wbGUu ZWwgYi9saXNwL3NpbXBsZS5lbAppbmRleCAzNjlmYmY3MTkyLi4yY2Y4YzEzMjI1IDEwMDY0NAot LS0gYS9saXNwL3NpbXBsZS5lbAorKysgYi9saXNwL3NpbXBsZS5lbApAQCAtNjMwLDE0ICs2MzAs MTMgQEAgZGVsZXRlLXRyYWlsaW5nLXdoaXRlc3BhY2UKICAgICAoc2F2ZS1leGN1cnNpb24KICAg ICAgIChsZXQgKChlbmQtbWFya2VyIChhbmQgZW5kIChjb3B5LW1hcmtlciBlbmQpKSkpCiAgICAg ICAgIChnb3RvLWNoYXIgKG9yIHN0YXJ0IChwb2ludC1taW4pKSkKLSAgICAgICAgKHdpdGgtc3lu dGF4LXRh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gICAgICAgICAgICAoc2V0LW1hcmtl ciBlbmQtbWFya2VyIG5pbCkKICAgICAgICAgICA7OyBEZWxldGUgdHJhaWxpbmcgZW1wdHkgbGlu ZXMuCi0tIAoyLjExLjEKCg== --f4030435d0d85a0d99054ad0528a--