[NTG-context] Using ConTeXt-LMTX for modern Mathematically-Literate-Programming 1/2

Stephen Gaito stephen at perceptisys.co.uk
Thu Dec 3 17:53:22 CET 2020


Thanks for your comments... see below...

On Thu, 3 Dec 2020 12:15:46 +0100
Taco Hoekwater <taco at elvenkind.com> wrote:

> > On 3 Dec 2020, at 11:35, Stephen Gaito <stephen at perceptisys.co.uk>
> > wrote:
> > 
> > Hans,
> > 
> > As I said my desktop is elderly... it has a 2.8GHz processor, 16Gb
> > of DDR3 memory, and a couple of old SATA1 hard disks, and only 3Mb
> > of CPU cache...
> > 
> > ... all well past its use by date for single threaded ConTeXt. ;-(
> > 
> > So one way to get better performance for ConTeXt is to invest in a
> > new ultra fast processor. Which will cost a lot, and use a lot of
> > power which has to be cooled, which uses even more power....  
> Startup time can be improved quite a bit with an SSD. Even a cheap
> SATA SSD is already much faster than a traditional harddisk. Doesn’t
> help with longer documents, but it could be a fairly cheap upgrade.
> I can’t comment on how to speed up the rest of what you are doing,
> but generally multi-threading TeX typesetting jobs is so hard as to
> be impossible in practise. About the only step that can be split off
> is the generation of the PDF, and even there the possible gain is 
> quite small (as you noticed already).
> Typesetting is a compilation job, so the two main ways to speed things
> along are
> 1) split the source into independent tasks, like in a code compiler
>    that splits code over separate .c / .cpp / .m / .p etc. files,
>    and then combine the results (using e.g. mutool)

This is basically my approach... *However*, while the dependency graph
for a standard compilation has been engineered to be an acyclic tree,
for a ConTeXt "compilation", the "*.tex" file has a cyclic dependency
on the (generated) "*.tuc" file.

Basically my parallelization "build manager" has to unroll or other
wise reimplement the mtx-context.lua 

  for currentrun=1,maxnofruns do

loop until the `multipass_changed(oldhash,newhash)` returns `false`.

Followed by a "pdf-linking" stage (possibly implemented, as you suggest,
by `mutool`) ....

Not great.... but it might work... (and I am willing to give it a

> 2) precompile recurring stuff (in TeX, that would mean embedding
>    separately generated pdfs or images)
> Best wishes,
> Taco
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an
> entry to the Wiki!
> maillist : ntg-context at ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context webpage  :
> http://www.pragma-ade.nl / http://context.aanhet.net archive  :
> https://bitbucket.org/phg/context-mirror/commits/ wiki     :
> http://contextgarden.net
> ___________________________________________________________________________________

More information about the ntg-context mailing list