ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* two suggestions to \typesetbuffer
@ 2013-11-08 18:11 Pablo Rodriguez
  2013-11-08 22:39 ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Pablo Rodriguez @ 2013-11-08 18:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear Hans,

I have presentations that include buffers typeset with \typesetbuffer.

One of the presentation includes 33 buffers, which are small ConTeXt
samples.

Any time I change anything on the presentation (not on the buffers
themselves), every buffer is typeset again. And the compilation time is
longer than probably desired.

My first suggestion would be to skip compiling buffers again, if the
following three requirements are met:

1. Buffer content (.tmp file, I guess) is identical (checked with a
hash) with the previous one from last compilation.

2. PDF file hasn’t been changed since previous complete compilation (md5
sum again).

3. Buffer content was correctly compiled in previous compilation.

My second suggestion may be a bit complex to implement, but I think it
would be useful. Wouldn’t it be possible that the fonts are only
embedded one in the presentation?

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: two suggestions to \typesetbuffer
  2013-11-08 18:11 two suggestions to \typesetbuffer Pablo Rodriguez
@ 2013-11-08 22:39 ` Hans Hagen
  2013-11-09 11:49   ` Pablo Rodriguez
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2013-11-08 22:39 UTC (permalink / raw)
  To: ntg-context

On 11/8/2013 7:11 PM, Pablo Rodriguez wrote:
> Dear Hans,
>
> I have presentations that include buffers typeset with \typesetbuffer.
>
> One of the presentation includes 33 buffers, which are small ConTeXt
> samples.
>
> Any time I change anything on the presentation (not on the buffers
> themselves), every buffer is typeset again. And the compilation time is
> longer than probably desired.
>
> My first suggestion would be to skip compiling buffers again, if the
> following three requirements are met:
>
> 1. Buffer content (.tmp file, I guess) is identical (checked with a
> hash) with the previous one from last compilation.

no temp file is used but a although a hash is possible it also means a 
lot of extra housekeeping due to the fact that buffers are reused (in 
which case no run happens)

> 2. PDF file hasn’t been changed since previous complete compilation (md5
> sum again).

takes time so less to gain there

> 3. Buffer content was correctly compiled in previous compilation.

define correctly

> My second suggestion may be a bit complex to implement, but I think it
> would be useful. Wouldn’t it be possible that the fonts are only
> embedded one in the presentation?

how often does it happen ... if we're talking about one page files 
processing should normally fast e.g.

\setupbodyfont[pagella] \starttext \input tufte \stoptext

takes .3 seconds on my laptop.

normally fonts are embedded efficiently (subsets) and shared

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: two suggestions to \typesetbuffer
  2013-11-08 22:39 ` Hans Hagen
@ 2013-11-09 11:49   ` Pablo Rodriguez
  2013-11-09 12:03     ` Wolfgang Schuster
  2013-11-10 11:30     ` Hans Hagen
  0 siblings, 2 replies; 7+ messages in thread
From: Pablo Rodriguez @ 2013-11-09 11:49 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 11/08/2013 11:39 PM, Hans Hagen wrote:
> On 11/8/2013 7:11 PM, Pablo Rodriguez wrote:
>> Dear Hans,
>>
>> I have presentations that include buffers typeset with \typesetbuffer.
>>
>> One of the presentation includes 33 buffers, which are small ConTeXt
>> samples.
>>
>> Any time I change anything on the presentation (not on the buffers
>> themselves), every buffer is typeset again. And the compilation time is
>> longer than probably desired.
>>
>> My first suggestion would be to skip compiling buffers again, if the
>> following three requirements are met:
>>
>> 1. Buffer content (.tmp file, I guess) is identical (checked with a
>> hash) with the previous one from last compilation.
> 
> no temp file is used but a although a hash is possible it also means a 
> lot of extra housekeeping due to the fact that buffers are reused (in 
> which case no run happens)

Compiling the presentation I‘m talking about for the first time on my
laptop takes about 210 seconds. Every subsequent compilation takes about
70 seconds.

I know my laptop is old and slow.

But if I make a copy of the presentation source and remove the
\typesetbuffer commands, first compilation takes about 22 seconds and
subsequent compilations take about 7 seconds.

I have no idea on how ConTeXt works internally, but what I’m trying to
say is that if \typesetbuffer has been already compiled, compiling again
is no gain.

>> 3. Buffer content was correctly compiled in previous compilation.
> 
> define correctly

I meant completely compiled: PDF has been generated.

>> My second suggestion may be a bit complex to implement, but I think it
>> would be useful. Wouldn’t it be possible that the fonts are only
>> embedded one in the presentation?
> 
> how often does it happen ... if we're talking about one page files 
> processing should normally fast e.g.
> 
> \setupbodyfont[pagella] \starttext \input tufte \stoptext
> 
> takes .3 seconds on my laptop.
> 
> normally fonts are embedded efficiently (subsets) and shared

Sorry, there was a typo in my message: “that fonts are only embedded
once in the presentation”.

My second suggestion isn’t about compilation time, but about duplicated
fonts.

I tried to provide a sample, but I don’t know why it doesn’t work:

\starttext
These are bufers:

\dorecurse{10}{\startbuffer[text:\recurselevel]\setuppapersize[A7]\starttext\input
tufte\stoptext\stopbuffer\typesetbuffer[text:\recurselevel][frame=on]}
\stoptext

Of course, fonts are embedded fine in documents, but \typesetbuffer is a
special case. Having the fonts embedded only once in the final document
would be better.

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: two suggestions to \typesetbuffer
  2013-11-09 11:49   ` Pablo Rodriguez
@ 2013-11-09 12:03     ` Wolfgang Schuster
  2013-11-10 11:30     ` Hans Hagen
  1 sibling, 0 replies; 7+ messages in thread
From: Wolfgang Schuster @ 2013-11-09 12:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 09.11.2013 um 12:49 schrieb Pablo Rodriguez <oinos@gmx.es>:

> On 11/08/2013 11:39 PM, Hans Hagen wrote:
>> On 11/8/2013 7:11 PM, Pablo Rodriguez wrote:
>>> Dear Hans,
>>> 
>>> I have presentations that include buffers typeset with \typesetbuffer.
>>> 
>>> One of the presentation includes 33 buffers, which are small ConTeXt
>>> samples.
>>> 
>>> Any time I change anything on the presentation (not on the buffers
>>> themselves), every buffer is typeset again. And the compilation time is
>>> longer than probably desired.
>>> 
>>> My first suggestion would be to skip compiling buffers again, if the
>>> following three requirements are met:
>>> 
>>> 1. Buffer content (.tmp file, I guess) is identical (checked with a
>>> hash) with the previous one from last compilation.
>> 
>> no temp file is used but a although a hash is possible it also means a 
>> lot of extra housekeeping due to the fact that buffers are reused (in 
>> which case no run happens)
> 
> Compiling the presentation I‘m talking about for the first time on my
> laptop takes about 210 seconds. Every subsequent compilation takes about
> 70 seconds.
> 
> I know my laptop is old and slow.
> 
> But if I make a copy of the presentation source and remove the
> \typesetbuffer commands, first compilation takes about 22 seconds and
> subsequent compilations take about 7 seconds.
> 
> I have no idea on how ConTeXt works internally, but what I’m trying to
> say is that if \typesetbuffer has been already compiled, compiling again
> is no gain.

Try the filter module: https://github.com/adityam/filter

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: two suggestions to \typesetbuffer
  2013-11-09 11:49   ` Pablo Rodriguez
  2013-11-09 12:03     ` Wolfgang Schuster
@ 2013-11-10 11:30     ` Hans Hagen
  2013-11-10 12:32       ` Pablo Rodriguez
  1 sibling, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2013-11-10 11:30 UTC (permalink / raw)
  To: ntg-context

On 11/9/2013 12:49 PM, Pablo Rodriguez wrote:

> Of course, fonts are embedded fine in documents, but \typesetbuffer is a
> special case. Having the fonts embedded only once in the final document
> would be better.

You can try the beta ... i'm not sure about it yes but this one is 
faster, we might end up with several methods to choose from depending on 
usage.

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: two suggestions to \typesetbuffer
  2013-11-10 11:30     ` Hans Hagen
@ 2013-11-10 12:32       ` Pablo Rodriguez
  2013-11-10 15:29         ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Pablo Rodriguez @ 2013-11-10 12:32 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 11/10/2013 12:30 PM, Hans Hagen wrote:
> 
> You can try the beta ... i'm not sure about it yes but this one is 
> faster, we might end up with several methods to choose from depending on 
> usage.

Many thanks for the improvement, Hans.

Compilation for the first time decreased from 210 seconds to 181
seconds. And subsequent compilations decreased from 70 seconds to 7 seconds.

The sample shows the issue with embedded fonts:

\starttext
These are bufers:

\startbuffer[text:1]
\setuppapersize[A7]
\starttext\input tufte\stoptext
\stopbuffer
\typesetbuffer[text:1][frame=on]

\startbuffer[text:2]
\setuppapersize[A7]
\starttext\input knuth\stoptext
\stopbuffer
\typesetbuffer[text:2][frame=on]
\stoptext

The same font is embedded three times in the final PDF. I wonder whether
it would be possible that the font would be only embedded once in the
final PDF.

Many thanks for your excellent work,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: two suggestions to \typesetbuffer
  2013-11-10 12:32       ` Pablo Rodriguez
@ 2013-11-10 15:29         ` Hans Hagen
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2013-11-10 15:29 UTC (permalink / raw)
  To: ntg-context

On 11/10/2013 1:32 PM, Pablo Rodriguez wrote:
> On 11/10/2013 12:30 PM, Hans Hagen wrote:
>>
>> You can try the beta ... i'm not sure about it yes but this one is
>> faster, we might end up with several methods to choose from depending on
>> usage.

> The same font is embedded three times in the final PDF. I wonder whether
> it would be possible that the font would be only embedded once in the
> final PDF.

unless something is wrong in the engine, the actual shapes of fonts 
should be shared but it looks like the subsets are embedded anyway ... 
something to look into (not a context issue afaiks)

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-11-10 15:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-08 18:11 two suggestions to \typesetbuffer Pablo Rodriguez
2013-11-08 22:39 ` Hans Hagen
2013-11-09 11:49   ` Pablo Rodriguez
2013-11-09 12:03     ` Wolfgang Schuster
2013-11-10 11:30     ` Hans Hagen
2013-11-10 12:32       ` Pablo Rodriguez
2013-11-10 15:29         ` Hans Hagen

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).