sorry the the context sample and latex sample are not equivalent
(note the \par).

So I test again:
\starttypescript[serif] [myzhfont]
 \definefontsynonym [Serif]           [file:SimSun]
 \definefontsynonym [SerifBold]       [file:SimSun]
 \definefontsynonym [SerifItalic]     [file:SimSun]
 \definefontsynonym [SerifBoldItalic] [file:SimSun]
\stoptypescript

\starttypescript[sans] [myzhfont]
 \definefontsynonym [Sans]           [file:SimSun]
 \definefontsynonym [SansBold]       [file:SimSun]
 \definefontsynonym [SansItalic]     [file:SimSun]
 \definefontsynonym [SansBoldItalic] [file:SimSun]
\stoptypescript

\starttypescript[mono] [myzhfont]
 \definefontsynonym [Mono]           [file:SimSun]
 \definefontsynonym [MonoBold]       [file:SimSun]
 \definefontsynonym [MonoItalic]     [file:SimSun]
 \definefontsynonym [MonoBoldItalic] [file:SimSun]
\stoptypescript

\definetypeface [myzhfont] [rm] [serif][myzhfont]   [default]
\definetypeface [myzhfont] [ss] [sans] [myzhfont]   [default]
\definetypeface [myzhfont] [tt] [mono] [myzhfont]   [default]

\def\a{\myzhfont}

\dorecurse{10000}{{hello {\a 你好}}\par}

\bye


XeConTeXt uses 45.502 seconds, while XeLaTeX uses 3 seconds.

2009/5/12 Yue Wang <yuleo...@gmail.com>:
> here is the xelatex result given by a chinese user:
>
> \documentclass{minimal}
> \usepackage{xeCJK}
> \setCJKfamilyfont{song}{SimSun}
> \begin{document}
> {hello {\CJKfamily{song}你好}}\par % 10000 lines
> \end{document}
>
> got 209 pages, three seconds to run.
> note he is switching  families 20000 times. (\family{foo} in latex ==
> \switchbodyfont[foo] in context)
>
> On Tue, May 12, 2009 at 5:30 PM, Hans Hagen <pra...@wxs.nl> wrote:
>> Yue Wang wrote:
>>> Hi,
>>>
>>> Sum up:
>>> define a font usng typescripts takes 64.797 seconds.
>>> define a font like \definefont[a][file:SimSun.ttf] takes 55.548 seconds
>>> define a font like \definefont[a][file:SimSun] takes 4.329 seconds
>>> define a font like \font\a="[simsun]" takes 1.812 seconds
>>>
>>> Jonathan and Jin-Hwan, sorry for the noise. I am now sure that it is a
>>> context bug, not xetex's.
>>
>> and
>>
>>> update: change the second example, remove the ".otf" suffix , and
>>> texexec --xtx gives:
>>> TeXExec | runtime: 5.766
>>> Obviously, this is a parsing bug in ConTeXt.
>>
>> context is not parsing for .otf or .ttf and has no reason for it either
>>
>> Hans
>>
>> -----------------------------------------------------------------
>>                                          Hans Hagen | PRAGMA ADE
>>              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>>     tel: 038 477 53 69 | fax: 038 477 53 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  : https://foundry.supelec.fr/projects/contextrev/
>> wiki     : http://contextgarden.net
>> ___________________________________________________________________________________
>>
>
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to