From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: [External] : Re: Performance of `re-search-backward' vs `re-search-forward' Date: Mon, 12 Apr 2021 20:40:36 +0000 Message-ID: References: <87czv0awpq.fsf@mbork.pl> <8735vvb8c5.fsf@mbork.pl> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12480"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "help-gnu-emacs@gnu.org" To: Marcin Borkowski , Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 12 22:41:32 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lW3NE-00039V-0G for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 12 Apr 2021 22:41:32 +0200 Original-Received: from localhost ([::1]:39786 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lW3NC-0007fT-Ti for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 12 Apr 2021 16:41:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45642) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lW3MU-0007ez-D3 for help-gnu-emacs@gnu.org; Mon, 12 Apr 2021 16:40:46 -0400 Original-Received: from userp2130.oracle.com ([156.151.31.86]:35464) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lW3MP-0003Oj-Ln for help-gnu-emacs@gnu.org; Mon, 12 Apr 2021 16:40:45 -0400 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13CKe6eZ106653; Mon, 12 Apr 2021 20:40:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2020-01-29; bh=//LkcluVo3qI2JDCFlYF3p9mfyRR39ljzBaUH0Ew9OE=; b=GsZOTrN/buaZr6tDYVNZNujHiE4mz+gh041G9t04WZA3YplpMtt5J0120lKsF6bI0jsL mCBj4pZoDZqST0+ARsmQoa9a/XtxaPZKFdziV90dOesOAJWPWCS9xGqkc5+L/I0T5Si6 MWaaqgJQkc7rMaeXRdyywXDTTESS3QGEVm08sYGWnaK2zq9Kt5S4e6m2ch4h0/3qhBjx rJ+wt32p6PhGdHDEPJPzkaajohGSWrQOkINME3TUbdpaHE3qdxhWsG2+FEuAWL/lH27q P43Sa26qWd2R3KVR9OSy/pUGRZfd4jsf0mHO/cZsW/psXmrwkig6X01Em3HmwO9p4eEu 6Q== Original-Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 37u3erd30p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 12 Apr 2021 20:40:39 +0000 Original-Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13CKVcu0140070; Mon, 12 Apr 2021 20:40:38 GMT Original-Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2173.outbound.protection.outlook.com [104.47.55.173]) by aserp3020.oracle.com with ESMTP id 37unwxun6x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 12 Apr 2021 20:40:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RAd13K1s0hdzKMEWRGQ+9NJZ9UYAaCyzlW2LIQQBTua0IsJFqCaB+UQ6DBLWbW2vNHi3iuL6P2hf614soHA7aRNFxcfPh0Mp40C3fPtHDeDybtBPf7mpvDd4N5l7rDl0gH3VKwKV+RYJrBvPdaGZ4HV8QKc+VRd1vXcpfDQgTAq5+4gdqWI9rZ/eiG3obm/v+Mfzn5jeoZEKmNVhyK3TYQx5nJH5FJf8b5xgVzzvKWJuC1VTaAElewJZy6REsiNs3QbbqYnStKefNvVOEW7oc+10R1nCFcVu9//MA+I7WR+QLGLVmiTRp6NjSppsaUx5ILTpHuUgkcCVd3LZxd3UZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=//LkcluVo3qI2JDCFlYF3p9mfyRR39ljzBaUH0Ew9OE=; b=FflCwqKa0RoPkg3SPi/NTgyLcbZWG+PflrFvj3PCsrHI/RUCH8C1U3GIXL+WbXyZoSsVu32AW3msVlnLPWrK8UbJVKHw9ef0ykqe2+Qs2sqYjv7cGokraMzoR4s7/uFHmfTzBzLRzG6QmdCyXDal8rzgxowHpkgr9YpO69F7gOwUsIwreVUMbL87QuL0J5mVfz2T4vMi4YOd2gBNs0D3VXzQb4hc5CnZhKo99z7IlzE1tIyIeeZaXufwpwW6k0CmWW5jHp9Pkk+4uzsP3OTx3p47HkB0B2LyLiC/fEELtjtbmtYGJcEOzHuPilmVzZAM3GsYMvNUbhqi3khK2TmlwQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=//LkcluVo3qI2JDCFlYF3p9mfyRR39ljzBaUH0Ew9OE=; b=eGPmL/4ms637P1/T6r3KexPoYm6jkyfkTgVN4zU/hugavu93H8UE3sXt+howW0a1xdRjN2FA7EFTSQqPVMip1bsOwgopNc+q2Uzgxh6Gqs8n1sMUS8Otm6tAkwISyRvTWFIm5Z5Ps3dUhL8vvVxlyWBcr8nZW3Nbs0VC/DqYMNk= Original-Received: from SA2PR10MB4474.namprd10.prod.outlook.com (2603:10b6:806:11b::15) by SA2PR10MB4588.namprd10.prod.outlook.com (2603:10b6:806:f8::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.21; Mon, 12 Apr 2021 20:40:36 +0000 Original-Received: from SA2PR10MB4474.namprd10.prod.outlook.com ([fe80::b8d2:db6d:3e4b:d315]) by SA2PR10MB4474.namprd10.prod.outlook.com ([fe80::b8d2:db6d:3e4b:d315%5]) with mapi id 15.20.4020.022; Mon, 12 Apr 2021 20:40:36 +0000 Thread-Topic: [External] : Re: Performance of `re-search-backward' vs `re-search-forward' Thread-Index: AQHXL9O/cwbAts0jg0SZ25Nv1izURqqxWBxw In-Reply-To: <8735vvb8c5.fsf@mbork.pl> Accept-Language: en-US Content-Language: en-US authentication-results: mbork.pl; dkim=none (message not signed) header.d=none;mbork.pl; dmarc=none action=none header.from=oracle.com; x-originating-ip: [73.170.83.28] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3b44a401-6f51-415b-86c9-08d8fdf33a3a x-ms-traffictypediagnostic: SA2PR10MB4588: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5236; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: oYm2tY2G8TSOieHYITizsCXYDGza8O9Iizgo7xFIcEKd7HeUpxcDLWG2rfn8A7LELL3kbwZbXIuvd571JaJvpd9uBiZLnMlTy10+etQNYaYVadSSOIaavkA/eULtF1xO3duVG0sRnKpxGgH1WgPzisk3SZOJTjohjILLr4uEHbqQTmp/JAFxs6TwgfWs8Ie5STCM5EbLAnIS9PJYaT8gePA1mw8Nj5UU8v8mZ8zMdas2akV8ZGBIWtUCz88anyYhQzs8c0xfYXCqz/ZHZlasUW17Zxo17bOYNu5/7YyP4Loh48/gKcVMr8vBKOnlswGkTPV6jbFD8O2wdHgOOSCYAQyfK9me/Seykqmt1K5PiVYa98Z+tiNBu1rakSFJXzn7EvTIrNov33G0Ig1xpVHzvC68skv467NCV223Qj4lU/85JEleDoXPQXIFu7Eau55PRg5HK4s8XPO5ZEcalo5GV338kz1R32tvnPktZ/dGNR2lZKzwFu6/0306f1aBKmBp5mnU7yiTYH6ijUp13EIVRrZK/LF0YWfYv3ICPHVn+kIXo491ep71jJ/5qqcBhwM+R7sfntNorQVr30y5mLj7ScXE+Ylq1P5OJMgsVLfI8K6z6urz3N7lDLZoXkMp7jHU6qXaKaHllYFIbJRr30yko1GpiWo3aitSnTIYHcrsYRb0Yr2NtHGHwRhIWQNTr6p5BuhZJzJVBbi9/0kSrSKy4ucZjdT5/euu2f6aZq5SMMQ= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA2PR10MB4474.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(39860400002)(346002)(396003)(366004)(376002)(136003)(8676002)(5660300002)(186003)(6506007)(64756008)(66446008)(558084003)(86362001)(478600001)(966005)(66556008)(7696005)(66946007)(8936002)(44832011)(52536014)(76116006)(55016002)(26005)(33656002)(2906002)(66476007)(38100700002)(9686003)(71200400001)(110136005)(316002)(4326008)(81973001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?w6OoXGx4xpcPwgT4FAbJRFXQqLbCEH8vmCn6niXJ54EX5Iw0io5OpwWUgc4y?= =?us-ascii?Q?jPlfKJ8PUCrlNuc8fIwlz5+yy8owy8oS6uiSCwVgv/hLoLyzQ7kNzHknWW1i?= =?us-ascii?Q?u655M0myQO8l8uIAw4adn8TEzDVbwCmNS2FZW9RE+SCxiljY10UGnMHYgJqf?= =?us-ascii?Q?qdHovvjaayodk/TSHtdTAaqBibL5txAIu+vP+zLvZbcZYQj7JpSJogE9RUF1?= =?us-ascii?Q?8CVUxqedurrjHKSTGPkrGghEOKQmah0CXRq3LOHWNHlaUslr3JdbRkdydLH1?= =?us-ascii?Q?Hu/Q6qr8Qa4+urndXC6e4KL0/M0nM+tqhVx25m92o1OmzZ3UQ6fsITbOcd/D?= =?us-ascii?Q?YPbrnoI5p+ZIqukYTXb9boOWFafSUtDBL8+kycpYxftAQv1IogQQKmkDwfK2?= =?us-ascii?Q?ItxeuysQjZATHGzfLgvBpwhLgMftvCpKOyYNqw/kdu8ZkAStSQm0kffTbOBd?= =?us-ascii?Q?Q0Kv7RWWR72gnMEJJ37LhuUyyW1o1fWs2EvdQSGrZrbP1lttjKLn9k9r2GHk?= =?us-ascii?Q?0doBIX6wHdKsuzy4/fAdLrSHsX03CR8OXefZQ/GSRfdgxrehI8x+0cCnws3L?= =?us-ascii?Q?LVN0KJ69poXWuwNKxXvTuilHWiqCv+OvgKEMxZU1iuoFRwTBZgZq0OCmLlBq?= =?us-ascii?Q?j+5a x-ms-exchange-transport-forked: True X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA2PR10MB4474.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3b44a401-6f51-415b-86c9-08d8fdf33a3a X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Apr 2021 20:40:36.7903 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: CSQaYoWtkaN8Mu3LwtAGTAgCSHTG9TbrhCUHhFm6Rhnz+xXc5ujVCDapP61rreFjgNGgrdjHlk0D63vdn/RHKQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4588 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9952 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 suspectscore=0 mlxscore=0 malwarescore=0 adultscore=0 bulkscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104120132 X-Proofpoint-ORIG-GUID: eMEIrc8jGgeg1YsFn1MXlnzmqdQwFGrB X-Proofpoint-GUID: eMEIrc8jGgeg1YsFn1MXlnzmqdQwFGrB X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9952 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 clxscore=1015 adultscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 spamscore=0 impostorscore=0 suspectscore=0 mlxscore=0 phishscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104120133 Received-SPF: pass client-ip=156.151.31.86; envelope-from=drew.adams@oracle.com; helo=userp2130.oracle.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:128976 Archived-At: > So both basically move character by character and check if the regex > matches there (more or less)? They don't move character by character. They use the Boyer-Moore search algorithm. https://en.wikipedia.org/wiki/Boyer%E2%80%93Moore_string-search_algorithm