Sign up ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I wanted to see whether some macros I wrote could be made noticeably quicker by eliminating the use of parsed PGF math commands, in favour of using the PGF math function macros (\pgfmathadd, etc.) directly. (Answer: it looks like maybe they can, but not by an enormous amount.) I used the PGF Profiler library to perform 10 runs over a test document using the original code, and then 10 runs using the modified code. You can find the results here:

One thing I noticed was that all of the numbers reported seem to be very close to an integer number of seconds. Not exactly an integer number, but generally not more than 0.001 away. And not always the same integer for the same measurement, either; they vary from one integer value to another, but they're always very nearly an integer. Why might this happen?

The test document is here: and the original and modified versions of the code (loaded with an invocation of \input) are here: and here:

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.