From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Pixel-based display functions Date: Fri, 06 Feb 2015 09:45:57 +0200 Message-ID: <83h9uzeb4a.fsf@gnu.org> References: <83lhkkl23i.fsf@gnu.org> <83bnlgkl1s.fsf@gnu.org> <837fw3l7uz.fsf@gnu.org> <54CD4B27.4080201@gmx.at> <874mr6qvi5.fsf@building.gnus.org> <87sieqpfxh.fsf@building.gnus.org> <54CDE908.7050908@gmx.at> <87ioflq0dz.fsf@building.gnus.org> <54CE2187.9070003@gmx.at> <83lhkhiq8t.fsf@gnu.org> <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> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1423208779 28553 80.91.229.3 (6 Feb 2015 07:46:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Feb 2015 07:46:19 +0000 (UTC) Cc: rudalics@gmx.at, monnier@IRO.UMontreal.CA, emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 06 08:46:18 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 1YJdcI-0006IH-M8 for ged-emacs-devel@m.gmane.org; Fri, 06 Feb 2015 08:46:18 +0100 Original-Received: from localhost ([::1]:47046 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJdcI-0006b3-1A for ged-emacs-devel@m.gmane.org; Fri, 06 Feb 2015 02:46:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37335) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJdcC-0006ay-Gi for emacs-devel@gnu.org; Fri, 06 Feb 2015 02:46:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJdc7-0002eM-H8 for emacs-devel@gnu.org; Fri, 06 Feb 2015 02:46:12 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:49943) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJdc7-0002e6-9G for emacs-devel@gnu.org; Fri, 06 Feb 2015 02:46:07 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NJC00400AV8F200@a-mtaout22.012.net.il> for emacs-devel@gnu.org; Fri, 06 Feb 2015 09:46:00 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NJC004E3AWODQ20@a-mtaout22.012.net.il>; Fri, 06 Feb 2015 09:46:00 +0200 (IST) In-reply-to: <874mqzvnwo.fsf@building.gnus.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.172 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:182501 Archived-At: > From: Lars Ingebrigtsen > Cc: emacs-devel@gnu.org, Eli Zaretskii , > martin rudalics > Date: Fri, 06 Feb 2015 12:17:43 +1100 > > I've been doing some benchmarking to get a feel for the speed of > `vertical-motion'. > > shr-tag-body 100 2.2069731249 0.0220697312 > shr-fold-lines 100 1.2538841410 0.0125388414 > shr-fold-line 1500 1.2457802040 0.0008305201 > shr-goto-pixel-column 5000 1.1738643779 0.0002347728 > > `shr-goto-pixel-column' is just a call to `vertical-motion' separated > out to see how much time it takes. > > So, basically, folding 1500 lines takes 1.24s, of which 1.17s is spent > in `vertical-motion' (plus function call overhead). (It's called a lot > of times because the lines are very long and need to be filled more than > once.) Can you explain why you need to call vertical-motion so many times? > But it's all kinda moot since `window-text-pixel-size' doesn't work on > non-displayed buffers (yet). window-text-pixel-size is equivalent to vertical-motion, so I don't understand why you need both. Can you explain? More generally, perhaps you could post an outline of your algorithm(s), so that their overall design could be kept in mind. It just could be that the speedups you are looking for are on the algorithm level, not on the level of primitives. > I wonder whether a faster interface would be to have a version of > `window-text-pixel-size' that returns a vector of glyph sizes. ??? Isn't that font-get-glyphs that you already tried? If not, why not? What API would you like to have for that hypothetical function? > Of course, computing the vector may be unreasonably slow. It is again equivalent to vertical-motion and font-get-glyphs, so it's not slow. But I don't yet see the issue clearly enough to tell what could be done for you, so please post more information about what you are trying to do.