From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Antipov Newsgroups: gmane.emacs.devel Subject: Re: [RFC, experimental] save_{excursion,restriction} Date: Tue, 24 Jul 2012 09:16:39 +0400 Message-ID: <500E2FB7.4080006@yandex.ru> References: <500D84B6.50303@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050206040809070405010902" X-Trace: dough.gmane.org 1343106863 27879 80.91.229.3 (24 Jul 2012 05:14:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 24 Jul 2012 05:14:23 +0000 (UTC) Cc: Emacs development discussions To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 24 07:14:23 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1StXRu-0006IC-Ex for ged-emacs-devel@m.gmane.org; Tue, 24 Jul 2012 07:14:22 +0200 Original-Received: from localhost ([::1]:56027 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StXRt-0001GL-Hh for ged-emacs-devel@m.gmane.org; Tue, 24 Jul 2012 01:14:21 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StXRo-0001FP-Ox for emacs-devel@gnu.org; Tue, 24 Jul 2012 01:14:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1StXRn-0005Sv-1K for emacs-devel@gnu.org; Tue, 24 Jul 2012 01:14:16 -0400 Original-Received: from forward4.mail.yandex.net ([77.88.46.9]:51030) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StXRm-0005Sn-G6 for emacs-devel@gnu.org; Tue, 24 Jul 2012 01:14:14 -0400 Original-Received: from smtp4.mail.yandex.net (smtp4.mail.yandex.net [77.88.46.104]) by forward4.mail.yandex.net (Yandex) with ESMTP id EA9611BC15FE; Tue, 24 Jul 2012 09:14:12 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1343106853; bh=WMMqVpxTG/EoniBDXpJXazgX0a6ROrIL/yolCkVe3Co=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type; b=HV+cEDUKb36Bf+tpbIBnYcBCxvBjvzEqF6aJl+d5XGeFW5vmdRV9yd7rqFQvHKhKI hnPnpmpNdZBrefZS7SSJJ0fBIuRgPWfibY+tjDU6Xdd1nhOBFvxGziJO/KRbVClaLQ cfHUq49P96c+Y+PciMKiCS6Ieef61ezyXSjc5Cwg= Original-Received: from smtp4.mail.yandex.net (localhost [127.0.0.1]) by smtp4.mail.yandex.net (Yandex) with ESMTP id C8C065C0784; Tue, 24 Jul 2012 09:14:12 +0400 (MSK) Original-Received: from unknown (unknown [37.139.84.55]) by smtp4.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ECK8wI0R-ECK8k3BD; Tue, 24 Jul 2012 09:14:12 +0400 X-Yandex-Rcpt-Suid: monnier@IRO.UMontreal.CA X-Yandex-Rcpt-Suid: emacs-devel@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1343106852; bh=WMMqVpxTG/EoniBDXpJXazgX0a6ROrIL/yolCkVe3Co=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type; b=tq2Fci3LhO7Z781s5ZvloGXCMn8AVxVpav/tIHwRZvmDUW4Ap3Ch3IxDnpOOe/vPO kUhFla1b42kID+DCkepAo6fBM/WSNl3EIZqXTYDbP9H1MADsYLgtOrSb25iCi9tV49 /wwBv9LUcbKisBe5X6bTLd2p+JWIIW3SWoWyRcZU= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120713 Thunderbird/14.0 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 77.88.46.9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:151842 Archived-At: This is a multi-part message in MIME format. --------------050206040809070405010902 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 07/24/2012 03:45 AM, Stefan Monnier wrote: > BTW, could you resend your patch but changing it so the new > save_excursion_save/save_excursion_restore replace the old one directly > in the text, so the patch hunks show what is changed and what > stays unchanged? > Also, you need to mark the `excursions' field during GC. OK. > PS: Another source of slowdown for save-excursion is the unchain_marker call. Yes, I believe that markers needs substantial redesign too. Dmitry --------------050206040809070405010902 Content-Type: text/plain; charset=UTF-8; name="excursion_2.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="excursion_2.patch" PT09IG1vZGlmaWVkIGZpbGUgJ3NyYy9hbGxvYy5jJwotLS0gc3JjL2FsbG9jLmMJMjAxMi0w Ny0yMyAxMToxNTo0MyArMDAwMAorKysgc3JjL2FsbG9jLmMJMjAxMi0wNy0yNCAwNDo1Nzo1 OCArMDAwMApAQCAtMzY1OCwxMSArMzY1OCw4IEBACiAKICAgdmFsID0gYWxsb2NhdGVfbWlz YyAoTGlzcF9NaXNjX01hcmtlcik7CiAgIHAgPSBYTUFSS0VSICh2YWwpOwotICBwLT5idWZm ZXIgPSAwOwotICBwLT5ieXRlcG9zID0gMDsKLSAgcC0+Y2hhcnBvcyA9IDA7CisgIElOSVRf TUFSS0VSIChwLCBOVUxMLCAwLCAwLCAwKTsKICAgcC0+bmV4dCA9IE5VT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ICAgICAgc2V0X3Bvc2l0aW9uIChYTUFSS0VSIChwb3NpdGlvbikpOwogICAgICAg cmV0dXJuIHBvc2l0aW9uOwogICAgIH0KIApAQCAtODIxLDEwNCArODI3LDEwMSBAQAogCQkJ ICAgICAgUW5pbCwgUXQsIFFuaWwpOwogfQogCi0MCisvKiBTYXZlIGN1cnJlbnQgYnVmZmVy IHN0YXRlIGJlZm9yZSBlbnRlcmluZyBGc2F2ZV9leGN1cnNpb24uICAqLworCiBMaXNwX09i amVjdAogc2F2ZV9leGN1cnNpb25fc2F2ZSAodm9pZCkKIHsKLSAgaW50IHZpc2libGUgPSAo WEJVRkZFUiAoWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93KS0+YnVmZmVyKQotCQkgPT0gY3Vy cmVudF9idWZmZXIpOwotCi0gIHJldHVybiBGY29ucyAoRnBvaW50X21hcmtlciAoKSwKLQkJ RmNvbnMgKEZjb3B5X21hcmtlciAoQlZBUiAoY3VycmVudF9idWZmZXIsIG1hcmspLCBRbmls KSwKLQkJICAgICAgIEZjb25zICh2aXNpYmxlID8gUXQgOiBRbmlsLAotCQkJICAgICAgRmNv bnMgKEJWQVIgKGN1cnJlbnRfYnVmZmVyLCBtYXJrX2FjdGl2ZSksCi0JCQkJICAgICBzZWxl Y3RlZF93aW5kb3cpKSkpOworICBMaXNwX09iamVjdCBidWY7CisgIHN0cnVjdCBleGN1cnNp b24gKmV4OworICBzdHJ1Y3Qgd2luZG93ICp3ID0gWFdJTkRPVyAoc2VsZWN0ZWRfd2luZG93 KTsKKyAgc3RydWN0IExpc3BfTWFya2VyICptID0gWE1BUktFUiAoQlZBUiAoY3VycmVudF9i dWZmZXIsIG1hcmspKTsKKworICBleCA9IHhtYWxsb2MgKHNpemVvZiAqZXgpOworICBleC0+ d2luZG93ID0gdzsKKyAgZXgtPnZpc2libGUgPSAoWEJVRkZFUiAody0+YnVmZmVyKSA9PSBj dXJyZW50X2J1ZmZlcik7CisgIGV4LT5hY3RpdmUgPSAh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jdCBzZXRfbWFya2VyX3Jlc3RyaWN0ZWRfYm90aCAoTGlzcF9PYmplY3Qs IExpc3BfT2JqZWN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBwdHJkaWZmX3QsIHB0cmRpZmZfdCk7CisJCQkJCSAgICAgICBwdHJkaWZmX3Qs IHB0cmRpZmZfdCk7CiBleHRlcm4gTGlzcF9PYmplY3QgYnVpbGRfbWFya2VyIChzdHJ1Y3Qg YnVmZmVyICosIHB0cmRpZmZfdCwgcHRyZGlmZl90KTsKK2V4dGVybiB2b2lkIGF0dGFjaF9t YXJrZXIgKHN0cnVjdCBMaXNwX01hcmtlciAqLCBzdHJ1Y3QgYnVmZmVyICosCisJCQkgICBw dHJkaWZmX3QsIHB0cmRpZmZfdCk7CiBleHRlcm4gdm9pZCBzeW1zX29mX21hcmtlciAodm9p ZCk7CiAKIC8qIERlZmluZWQgaW4gZmlsZWlvLmMgKi8KCj09PSBtb2RpZmllZCBmaWxlICdz cmMvbWFya2VyLmMnCi0tLSBzcmMvbWFya2VyLmMJMjAxMi0wNy0yMiAwNTozNzoyNCArMDAw MAorKysgc3JjL21hcmtlci5jCTIwMTItMDctMjQgMDQ6MzM6MjUgKzAwMDAKQEAgLTQyNyw3 ICs0MjcsNyBAQAogCiAvKiBDaGFuZ2UgTSBzbyBpdCBwb2ludHMgdG8gQiBhdCBDSEFSUE9T IGFuZCBCWVRFUE9TLiAgKi8KIAotc3RhdGljIGlubGluZSB2b2lkCit2b2lkCiBhdHRhY2hf bWFya2VyIChzdHJ1Y3QgTGlzcF9NYXJrZXIgKm0sIHN0cnVjdCBidWZmZXIgKmIsCiAJICAg ICAgIHB0cmRpZmZfdCBjaGFycG9zLCBwdHJkaWZmX3QgYnl0ZXBvcykKIHsKCg== --------------050206040809070405010902--