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: Mon, 04 Apr 2011 16:24:28 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17pre) Gecko/20110402 Lanikai/3.1.10pre


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]