From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Sebastian Sturm Newsgroups: gmane.emacs.devel Subject: Re: State of the overlay tree branch? Date: Thu, 22 Mar 2018 20:54:20 +0100 Message-ID: <7ef5398f-752a-fcd8-ff83-f95518d911e1@arkona-technologies.de> References: <834lldp18f.fsf@gnu.org> <9646341d-700b-4240-216b-8c0e753fa79f@arkona-technologies.de> <86d03e78-9984-f33e-a3f3-3faa4b34d78b@arkona-technologies.de> <83vadso9ad.fsf@gnu.org> <5155d5e2-6b5c-581e-89fe-4f3af717304f@arkona-technologies.de> <4c82fcbd-961a-c6ca-b1f0-6b85665cb339@arkona-technologies.de> <83po3zmf6o.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1521748352 1188 195.159.176.226 (22 Mar 2018 19:52:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 22 Mar 2018 19:52:32 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 22 20:52:28 2018 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 1ez6GA-0000D7-Us for ged-emacs-devel@m.gmane.org; Thu, 22 Mar 2018 20:52:27 +0100 Original-Received: from localhost ([::1]:34583 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ez6IE-0003do-8j for ged-emacs-devel@m.gmane.org; Thu, 22 Mar 2018 15:54:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52224) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ez6I7-0003dT-T5 for emacs-devel@gnu.org; Thu, 22 Mar 2018 15:54:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ez6I4-0007Tc-NX for emacs-devel@gnu.org; Thu, 22 Mar 2018 15:54:27 -0400 Original-Received: from smtp-out002.kontent.com ([81.88.40.216]:51612) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ez6I4-0007SB-DB for emacs-devel@gnu.org; Thu, 22 Mar 2018 15:54:24 -0400 Original-Received: from [172.16.98.0] (unknown [46.183.103.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: arkona-technologies_de_22@smtp-out002.kontent.com) by smtp-out002.kontent.com (Postfix) with ESMTPSA id 4AA84C004327E for ; Thu, 22 Mar 2018 20:54:21 +0100 (CET) In-Reply-To: Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 81.88.40.216 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:223919 Archived-At: > > It should do that without you asking. I mean, it won't show you > `goto-char` and `point-min` kind of things since these are "inlined" > (actually turned into their own byte-code), but `count-lines` should > definitely be there. > >> - let 18368 86% >> line-number-at-pos 18348 86% > > It's very odd that there's no `count-lines` down here (and `count-lines` > is a perfectly normal Elisp function that's not inlined or otherwise > treated specially), since it should be where most of the time is spent! when first evaluating simple.el as Eli suggested, the profiler indeed shows that pretty much all time is spent somewhere within `count-lines`. Unfortunately the patch didn't seem to help though I'll double-check at home (also, it seemed to improve baseline performance, but I'm not sure if I should regard that as a random fluctuation, will need to do more measurements). Also, this time even the first measurement with a small number of overlays was extremely slow, not sure what to make of that. In general however, the trend seems clear to me --- for this one file, overlays hurt `line-number-at-pos` performance very much, except when using the noverlay branch. Are there other things I should look for in my file that might negatively affect performance (strange codepoints or anything else that might perhaps upset `buf_charpos_to_bytepos`)? baseline (emacs-27 master #667cdf42..., approx. 5-10 overlays created by flycheck): iteration 1: 0.012696 iteration 2: 0.002595 iteration 3: 0.002606 iteration 4: 0.002601 iteration 5: 0.002649 iteration 6: 0.002605 iteration 7: 0.002594 iteration 8: 0.002601 iteration 9: 0.002603 iteration 10: 0.002601 iteration 11: 0.002606 iteration 12: 0.002626 iteration 13: 0.002603 iteration 14: 0.002642 iteration 15: 0.002599 iteration 16: 0.002598 iteration 17: 0.002600 iteration 18: 0.002601 iteration 19: 0.002599 iteration 20: 0.002608 emacs-27 master, approx. 6200 overlays created by (test-highlight) iteration 1: 0.022795 iteration 2: 0.015560 iteration 3: 0.015697 iteration 4: 0.015913 iteration 5: 0.015894 iteration 6: 0.016063 iteration 7: 0.015928 iteration 8: 0.015890 iteration 9: 0.015278 iteration 10: 0.015515 iteration 11: 0.015327 iteration 12: 0.015326 iteration 13: 0.015574 iteration 14: 0.015319 iteration 15: 0.015370 iteration 16: 0.015354 iteration 17: 0.015333 iteration 18: 0.015312 iteration 19: 0.015481 iteration 20: 0.015411 emacs-27 master + patch "distance+10", ~10 overlays created by flycheck: iteration 1: 0.002938 iteration 2: 0.001132 iteration 3: 0.000550 iteration 4: 0.000468 iteration 5: 0.000470 iteration 6: 0.000451 iteration 7: 0.000449 iteration 8: 0.000451 iteration 9: 0.000450 iteration 10: 0.000449 iteration 11: 0.000448 iteration 12: 0.000452 iteration 13: 0.000451 iteration 14: 0.000443 iteration 15: 0.000448 iteration 16: 0.000443 iteration 17: 0.000444 iteration 18: 0.000445 iteration 19: 0.000445 iteration 20: 0.000445 emacs-27 master + patch "distance+10", ~6200 overlays created by (test-highlight): iteration 1: 0.019673 iteration 2: 0.014469 iteration 3: 0.014491 iteration 4: 0.014430 iteration 5: 0.014493 iteration 6: 0.014704 iteration 7: 0.014741 iteration 8: 0.014536 iteration 9: 0.014433 iteration 10: 0.014469 iteration 11: 0.014429 iteration 12: 0.014509 iteration 13: 0.014484 iteration 14: 0.014487 iteration 15: 0.014524 iteration 16: 0.014449 iteration 17: 0.014501 iteration 18: 0.014469 iteration 19: 0.014429 iteration 20: 0.014507 noverlay branch (#886933...), ~10 overlays: iteration 1: 0.002370 iteration 2: 0.001191 iteration 3: 0.001189 iteration 4: 0.001162 iteration 5: 0.001095 iteration 6: 0.001096 iteration 7: 0.000522 iteration 8: 0.000531 iteration 9: 0.000369 iteration 10: 0.000365 iteration 11: 0.000365 iteration 12: 0.000366 iteration 13: 0.000365 iteration 14: 0.000380 iteration 15: 0.000367 iteration 16: 0.000365 iteration 17: 0.000365 iteration 18: 0.000365 iteration 19: 0.000363 iteration 20: 0.000368 noverlay branch, ~6200 overlays: iteration 1: 0.001878 iteration 2: 0.001831 iteration 3: 0.001838 iteration 4: 0.001826 iteration 5: 0.001027 iteration 6: 0.000722 iteration 7: 0.000531 iteration 8: 0.000479 iteration 9: 0.000480 iteration 10: 0.000479 iteration 11: 0.000479 iteration 12: 0.000479 iteration 13: 0.000478 iteration 14: 0.000479 iteration 15: 0.000478 iteration 16: 0.000478 iteration 17: 0.000482 iteration 18: 0.000479 iteration 19: 0.000480 iteration 20: 0.000476