integrate benchmarking properly
This commit is contained in:
parent
7fe4092d8e
commit
f80bd84852
1 changed files with 67 additions and 22 deletions
|
@ -5,7 +5,7 @@
|
|||
\keepsilent
|
||||
\usedir{tex/latex/mkessler/groupthm}
|
||||
\askforoverwritefalse
|
||||
\generate{\file{groupthm.sty}{\from{groupthm.dtx}{package}}}
|
||||
\generate{\file{groupthm.sty}{\from{groupthm.dtx}{package,benchmark}}}
|
||||
\def\tmpa{plain}
|
||||
\ifx\tmpa\fmtname\endgroup\expandafter\bye\fi
|
||||
\endgroup
|
||||
|
@ -836,6 +836,9 @@
|
|||
% \begin{macrocode}
|
||||
\RequirePackage{amsthm}
|
||||
\RequirePackage{thmtools}
|
||||
%<*benchmark>
|
||||
\RequirePackage{l3benchmark}
|
||||
%</benchmark>
|
||||
\RequirePackage{l3keys2e}
|
||||
% \end{macrocode}
|
||||
%
|
||||
|
@ -2782,12 +2785,18 @@
|
|||
% \begin{macrocode}
|
||||
\hook_gput_code:nnn { enddocument } { groupthm }
|
||||
{
|
||||
%<*benchmark>
|
||||
\@@_benchmark_once:nn
|
||||
{
|
||||
Benchmarking ~ writing ~ to ~ auxfile:
|
||||
}
|
||||
{
|
||||
%</benchmark>
|
||||
% \end{macrocode}
|
||||
% First, perform the regular dump:
|
||||
% \begin{macrocode}
|
||||
\clist_map_function:NN \g_@@_dump_auxfile_clist
|
||||
\_@@_write_auxout:n
|
||||
|
||||
% \end{macrocode}
|
||||
% Now, we want to dump the cached clist, but wrap it into the
|
||||
% the corresponding macro call for storing it in
|
||||
|
@ -2808,8 +2817,10 @@
|
|||
% \begin{macrocode}
|
||||
\clist_map_function:NN \g_@@_dump_cache_clist
|
||||
\_@@_write_auxout:n
|
||||
|
||||
\_@@_write_auxout:x { \str_use:N \c_right_brace_str }
|
||||
%<*benchmark>
|
||||
}
|
||||
%</benchmark>
|
||||
}
|
||||
% \end{macrocode}
|
||||
|
||||
|
@ -2897,14 +2908,30 @@
|
|||
\int_compare:nNnTF
|
||||
\g_@@_cache_version_aux_int < \g_@@_cache_version_document_int
|
||||
{
|
||||
%<*benchmark>
|
||||
\@@_benchmark_once:nn
|
||||
{
|
||||
Benchmarking ~ declarations ~ of ~ theorems ~ from ~ document:
|
||||
}
|
||||
{
|
||||
%</benchmark>
|
||||
\tl_use:N \g_@@_lazy_document_tl
|
||||
%<*benchmark>
|
||||
}
|
||||
%</benchmark>
|
||||
}
|
||||
{
|
||||
\exp_args:NNV \iow_now:Nn \l_my_iow \g_@@_lazy_auxfile_tl
|
||||
\benchmark_once:n
|
||||
%<*benchmark>
|
||||
\@@_benchmark_once:nn
|
||||
{
|
||||
Benchmarking ~ declarations ~ of ~ theorems ~ from ~ aux ~ file:
|
||||
}
|
||||
{
|
||||
%</benchmark>
|
||||
\tl_use:N \g_@@_lazy_auxfile_tl
|
||||
%<*benchmark>
|
||||
}
|
||||
%</benchmark>
|
||||
}
|
||||
}
|
||||
% \end{macrocode}
|
||||
|
@ -2962,11 +2989,29 @@
|
|||
%
|
||||
%
|
||||
%
|
||||
% \subsection{Benchmarking}
|
||||
%
|
||||
% Just some utility macro for benchmarking
|
||||
% some parts of the package.
|
||||
%
|
||||
%
|
||||
% \begin{macro}{\@@_benchmark:nn}
|
||||
%
|
||||
%
|
||||
%
|
||||
% \begin{macrocode}
|
||||
%
|
||||
%<*benchmark>
|
||||
\cs_new:Npn \@@_benchmark_once:nn #1
|
||||
{
|
||||
\iow_term:n { [groupthm] ~ #1 }
|
||||
\iow_log:n { [groupthm] ~ #1 }
|
||||
\benchmark_once:n
|
||||
}
|
||||
%</benchmark>
|
||||
% \end{macrocode}
|
||||
% \end{macro}
|
||||
%
|
||||
%
|
||||
%
|
||||
%
|
||||
% \begin{macrocode}
|
||||
|
|
Loading…
Reference in a new issue