From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Pixel-based display functions Date: Tue, 10 Feb 2015 15:48:15 +1100 Message-ID: <87egpytlrk.fsf@building.gnus.org> References: <54CE54A3.1020707@gmx.at> <838ughilmo.fsf@gnu.org> <54CE6BD2.8000402@gmx.at> <8361bliin0.fsf@gnu.org> <83386piiby.fsf@gnu.org> <87oap9yoti.fsf@building.gnus.org> <874mqzvnwo.fsf@building.gnus.org> <83h9uzeb4a.fsf@gnu.org> <87bnl7jrr7.fsf@building.gnus.org> <831tm3dt8u.fsf@gnu.org> <87k2zvgj4d.fsf@building.gnus.org> <83siejcahb.fsf@gnu.org> <83sieiar6i.fsf@gnu.org> <83oap5c480.fsf@gnu.org> <87d25lc3xu.fsf@building.gnus.org> <877fvtc2qj.fsf@building.gnus.org> <83wq3s9rmr.fsf@gnu.org> <878ug72064.fsf@building.gnus.org> <838ug79h3x.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1423543884 21886 80.91.229.3 (10 Feb 2015 04:51:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 10 Feb 2015 04:51:24 +0000 (UTC) Cc: rudalics@gmx.at, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 10 05:51:24 2015 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 1YL2nD-0002LF-3E for ged-emacs-devel@m.gmane.org; Tue, 10 Feb 2015 05:51:23 +0100 Original-Received: from localhost ([::1]:37002 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YL2nC-0003XP-DC for ged-emacs-devel@m.gmane.org; Mon, 09 Feb 2015 23:51:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51193) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YL2mz-0003X6-Ao for emacs-devel@gnu.org; Mon, 09 Feb 2015 23:51:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YL2my-00081x-6k for emacs-devel@gnu.org; Mon, 09 Feb 2015 23:51:09 -0500 Original-Received: from smtp.syd.comcen.com.au ([203.23.236.77]:4649) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YL2mu-0007wf-5z; Mon, 09 Feb 2015 23:51:04 -0500 Original-Received: from building.gnus.org ([27.96.197.126]) by smtp.syd.comcen.com.au (8.13.4/8.12.9) with ESMTP id t1A4mKVs027389; Tue, 10 Feb 2015 15:48:22 +1100 (EST) In-Reply-To: <838ug79h3x.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 09 Feb 2015 18:36:50 +0200") User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux) X-comcen-MailScanner-Information: Please contact the ISP for more information X-comcen-MailScanner: Found to be clean X-comcen-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=0.117, required 4, AWL 0.03, BAYES_20 -0.01, RDNS_NONE 0.10) X-comcen-MailScanner-From: larsi@gnus.org X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 203.23.236.77 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:182777 Archived-At: Eli Zaretskii writes: > Please try the latest master, where I implemented that. Great! > Contrary to what I wrote above, I decided to interpret the additional > argument in the same units as the COLS element of the cons cell that > is the first argument. I think this is better for consistency and > also more convenient, since both values are in the same units and both > can be floats, so no accuracy is lost. > > I'd be interested to know if this produces a noticeable speed-up. I did the measurements with this (over a variable-width text buffer): (benchmark-run 5000 (let ((start (point))) (vertical-motion (cons (/ 500 (frame-char-width)) 0) nil 0) (goto-char start))) Without the column parameter, and starting from beginning-of-line, it takes 1s. Starting from the first characters, it takes 0.6s. With the column parameter, and starting from beginning-of-line, it takes 0.2s. So improvement makes it about 3x faster than the previous best-case scenario, and 5x faster than the worst-case scenario (in this simple test). :-) The major single component that takes time when figuring out multi-column layouts now is the calls to (save-window-excursion (set-window-buffer nil (current-buffer)) (window-text-pixel-size ...)) If something could be done to make it faster to find out the (maximum) pixel width of a (possibly undisplayed) buffer, that would be a great win, I think. I'll apply the shr branch stuff to the trunk later today and post some new ELP traces with the new `vertical-motion' speedups. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog http://lars.ingebrigtsen.no/