RE: About Constructions rules

Subject: RE: About Constructions rules
From: Avi Kivity <Avi@xxxxxxxxxxxxx>
Date: Fri, 16 Jul 1999 00:21:49 +0300
On Friday, July 16, 1999 00:03, Chris Maden [SMTP:crism@xxxxxxxxxxx] wrote:
> 
> > This means that the rule is called, at most, once per grove per
> > mode. If any thrashing about is to be done, you have to specify it
> > explicitly. And of course it can be done lazily.
> 
> IF you have the entire grove available.  But with people using SGML in
> the real world on gigabyte documents, they don't want to do that.

Not at all. All you need is the grove-root. And you don't even need to begin
parsing to get it.

Consider:

   (query (empty-node-list) (process-node-list (sgml-parse
"-//The//Universe")))

This is a no-op. Neither the current grove nor the universe need to be
parsed.

> 
> And even so, when I started using (node-list-filter) expressions that
> forced Jade to abandon its ignorance of individual character nodes,
> processing time went up sixty fold (yes, that's 60, nearly two orders
> of magnitude).  Pre-analysis of a query might allow the equivalent of
> (select-by-class) to be done before the query is evaluated, but not
> always.
> 

A (query ...) is evaluated only once per grove per mode. The complexity of
what happens there is up to you. It can range from the trivial
(empty-node-list) to the ugliest node-walks imaginable.

The x60 processing time increase when individual characters are processed
seems reasonable, as the ratio of elements to characters is in that area. I
guess Jade does not node-ize text strings until required (the lazy
approach), taking advantage of the fact that the rules for character nodes
cannot be overridden. If you force it to give you these nodes, you pay the
price. But this is orthogonal to the way query-c-r's operate.
---
"The only words which have meaning are the last ones spoken"



 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread