texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Texmacs-dev] How texmacs is so slow for my macro


From: Sam Liddicott
Subject: Re: [Texmacs-dev] How texmacs is so slow for my macro
Date: Wed, 06 Apr 2011 13:48:37 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17pre) Gecko/20110404 Lanikai/3.1.10pre


I now override <item> with my own definition inside my environment - it'd based on the normal <item> definition but uses my own counter instead of next-item and the-item.

I'm doing this because saving item-nr when my environment finishes, and restoring item-nr again when my environment begins was found to be a major cause of slowness... i.e. doing it made insertion of new <item> nodes very slow.

However.... now I use my own counter I find things are just as slow! Unless I add this at the end of my environment:
<assign|<merge|code-line-|<value|nf-name>|-nr>|0>

to assign my counter to zero rather than leave the existing counted-to value.

In fact it doesn't matter what I assign it to, as long as it is a constant value.

I'm trying to come up with an explanation as to how this can be, and what the answer is to stop things being so low

(I'm using non-qt texmacs)

Sam

On 04/04/11 16:24, Sam Liddicott wrote:


Perhaps render-list should allow item-nr (or some other variable) to point to the name of the counter and not presume that the counter is always called: item

Working from that I will see if i can use a <with to override <item> and maybe get things to work a little faster that way.

Sam

On 04/04/11 08:23, Sam Liddicott wrote:


I simplified things to use a single global variable and still have the problem.

The problem seems to be to the storage and recall of the counter.


<with|...|item-nr|<value|pob>|
  ...
<render-list|<arg|body>>
  ...
<assign|pob|<value|item-nr>>
>

If I don't save the item-nr in pob, OR if I initialize the item-nr to a literal number, then updates are fast. Otherwise, on large documents, entering a new line in the custom list can be painfully slow (unless I press shift-enter so that <item> is not created).

Does any master have information on how saving AND recalling a counter from a global variable could cause this slowness? My guess is some magic that might be avoided perhaps with some sanitising lambda

Sam

On 04/04/11 08:00, Sam Liddicott wrote:


Texmacs is very slow for my literate programming macros which use custom lists.

I've pinned the problem down to the assignment of item-nr. Each named code-chunk can appear in multiple chunklets and has it's own line counter that is shared across all chunklets, so I assign item-nr to contain the counter-so-far before I render the list. (BTW I wish html export also recognized that item-nr may not start at 1):

Assigning item-nr as shown below makes things slow.

<with|...|item-nr|<value|<merge|code-line-|<value|nf-name>|-nr>>|
  ...
<render-list|<arg|body>>
  ...
>

Alternatively, if item-nr is assigned to a literal numeric value, like this:

<with|...|item-nr|29|
  ...
<render-list|<arg|body>>
  ...
>

then everything is fast.

I expect I need to do magic with eval and quasi and so on, but no amount of guessing has worked yet. I think I know that <with...> encloses all assignments in <quote> so I tried using <assign> instead with various incantations of quasi and eval but without success.

I need a master to give me a tip on this.... how can I early evaluate <value|<merge|code-line-|<value|nf-name>|-nr>> to become a numeric value?

Sam

_______________________________________________
Texmacs-dev mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/texmacs-dev






--
[FSF Associate Member #2325] <http://www.fsf.org/register_form?referrer=2325>

<http://www.openrightsgroup.org/>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]