Gnus development mailing list
 help / color / mirror / Atom feed
From: Julien Danjou <julien@danjou.info>
To: ding@gnus.org
Subject: Re: [PATCH] shr: render table with style
Date: Tue, 07 Dec 2010 18:00:48 +0100	[thread overview]
Message-ID: <sa3d3pdldq7.fsf@cigue.easter-eggs.fr> (raw)
In-Reply-To: <m362v5ley4.fsf@quimbies.gnus.org> (Lars Magne Ingebrigtsen's message of "Tue, 07 Dec 2010 17:34:27 +0100")

[-- Attachment #1: Type: text/plain, Size: 3015 bytes --]

On Tue, Dec 07 2010, Lars Magne Ingebrigtsen wrote:

> I find that in Gnus development, you really can't keep carping
> "developers, develop...", er, I mean, "speed, speed, speed" enough.  One
> adds one more obscure extra functionality because it's nice to have, and
> then you find that everything is 50% slower than before.  It's happened
> a lot...  and mostly with code I write myself.  :-)

I tend to agree, but I do not always suffer from it, so… :-)
OTOH, sometimes, we should just go on emacs-devel and yield that elisp
is too slow maybe. ;)

>> I've counted 15 color rendering points in it that should be rendered
>> correctly. Based on that, I've benchmarked the execution time and the
>> number of rendering point correctly done on current master version and
>> with my patched version.
>
> I'm not sure I'm seeing all the rendering points, but the obvious ones
> were the table/td/td {b,f}gcolor ones, right?

- Yellow background
- Green background
- Green HR
- Green bg LI (the star should be on green bg)
- red on white
- table must have pink borders
- table must have black background
- first left cell must be red on black
- second left cell must be red on blue
- third left and right cells should be red on orange
- white text on white background
- orange text on orange background
- white text on white background (same old)
- blue text on white background

And one I forgot. Or it's 14.

> I just did the obvious thing and altered -tag-table and -render-td to do
> colourisation like -tag-font, and, tada, with the following and your
> test HTML.  Before:
>
> (let ((doc
>        (save-excursion
> 	 (libxml-parse-html-region
> 	  (goto-char (point-min)) (search-forward "\n\n")))))
>   (benchmark-run-compiled 1000 (with-temp-buffer
> 				 (shr-insert-document doc))))
> => (3.0290269999999997 19 1.0066839999999786)
>
> After adding the -tag-table and -render-td colourisations (that should
> be a word):
>
> => (3.0097929999999997 19 1.0296220000000034)
>
> So that's, er, faster.  Ok, `benchmark-run-compiled' may not be the most
> precise benchmarking tool in the world, but...

0.02 on 3 in 1000 execution times… Well… :) 

> I didn't try to do TR handling, though, so yours is more ACID-ey.  Or
> bordercolor, but I don't really think the latter matters much...

Hehe. I understand, but where to draw the line is complicated then. What
we are doing is not that complicated after all, so I do not understand
why things are so slow, but well.

As I said, that's your call. You can still hack on your version to try
to pass my ACID test. But then I'll make the test harder so you'll end
up crazy with your special casing everywhere and I'll laugh at you.

Or just embrace the force and use my version which should work with
everything.

/me raises his hand in front of Lars and says:

   This is not the droid you're looking for.

-- 
Julien Danjou
// ᐰ <julien@danjou.info>   http://julien.danjou.info

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2010-12-07 17:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-06 17:30 Julien Danjou
2010-12-06 17:39 ` Lars Magne Ingebrigtsen
2010-12-06 17:42   ` Lars Magne Ingebrigtsen
2010-12-06 18:07     ` Lars Magne Ingebrigtsen
2010-12-07  9:19       ` Julien Danjou
2010-12-07 10:50         ` Lars Magne Ingebrigtsen
2010-12-07 11:16           ` Julien Danjou
2010-12-07 11:31             ` Lars Magne Ingebrigtsen
2010-12-07 11:38               ` Julien Danjou
2010-12-07 11:48                 ` Lars Magne Ingebrigtsen
2010-12-07 12:08                   ` Julien Danjou
2010-12-07 12:14                     ` Lars Magne Ingebrigtsen
2010-12-07 12:25                       ` Julien Danjou
2010-12-07 12:32                         ` Lars Magne Ingebrigtsen
2010-12-07 15:27                           ` Julien Danjou
2010-12-07 16:34                             ` Lars Magne Ingebrigtsen
2010-12-07 17:00                               ` Julien Danjou [this message]
2010-12-16 17:27                                 ` Lars Magne Ingebrigtsen
2010-12-17  9:23                                   ` Julien Danjou
2010-12-07  9:13     ` Julien Danjou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sa3d3pdldq7.fsf@cigue.easter-eggs.fr \
    --to=julien@danjou.info \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).