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: Sat, 07 Feb 2015 15:07:48 +1100 Organization: Programmerer Ingebrigtsen Message-ID: <87zj8qcqjv.fsf@building.gnus.org> References: <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> <83h9uzeb4a.fsf@gnu.org> <87bnl7jrr7.fsf@building.gnus.org> <831tm3dt8u.fsf@gnu.org> <87k2zvgj4d.fsf@building.gnus.org> <83siejcahb.fsf@gnu.org> <87bnl7gh7x.fsf@building.gnus.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1423282097 30463 80.91.229.3 (7 Feb 2015 04:08:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 7 Feb 2015 04:08:17 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 07 05:08:17 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 1YJwgr-0002lt-3X for ged-emacs-devel@m.gmane.org; Sat, 07 Feb 2015 05:08:17 +0100 Original-Received: from localhost ([::1]:51323 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJwgq-0001rl-93 for ged-emacs-devel@m.gmane.org; Fri, 06 Feb 2015 23:08:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48403) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJwgd-0001rd-SN for emacs-devel@gnu.org; Fri, 06 Feb 2015 23:08:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJwga-0002Rx-Mi for emacs-devel@gnu.org; Fri, 06 Feb 2015 23:08:03 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:57465) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJwga-0002RW-Gg for emacs-devel@gnu.org; Fri, 06 Feb 2015 23:08:00 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YJwgU-0002cQ-86 for emacs-devel@gnu.org; Sat, 07 Feb 2015 05:07:58 +0100 Original-Received: from 27.96.197.126 ([27.96.197.126]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 07 Feb 2015 05:07:54 +0100 Original-Received: from larsi by 27.96.197.126 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 07 Feb 2015 05:07:54 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 27 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 27.96.197.126 Mail-Copies-To: never User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:pmPKnYxJJNXRC0V0gQlclFUhqRM= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:182567 Archived-At: I've now reworked the table layout algorithm to behave more nicely when dealing with nested tables. As a test case, I'm using the "cat" Wikipedia genealogy table, which has tables in tables galore, and lots of little text snippets to try to fold. Here's the relevant data: shr-insert-document 1 5.11859327 5.11859327 shr-pixel-buffer-width 1940 1.8345742170 0.0009456568 shr-fold-lines 1579 1.7859513240 0.0011310648 shr-vertical-motion 2625 1.7517520130 0.0006673341 `shr-pixel-buffer-width' and `shr-vertical-motion' are just wrappers over `window-text-pixel-size' and `vertical-motion' respectively (for easier profiling). So out of the five seconds it takes to render the page now (which is, of course, way too slow to be usable), (+ 1.8 1.7) => 3.5s is spent moving to pixels and computing pixel widths. There may still be algorithmic fixes that can be done to get the number of calls down, but having the primitives be faster (i.e., the glyph width vector thing) may also help a lot... -- (domestic pets only, the antidote for overdose, milk.) bloggy blog http://lars.ingebrigtsen.no/