TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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: http://pastebin.com/AsvbH8p0

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: http://pastebin.com/Ef2VAQeR and the original and modified versions of the code (loaded with an invocation of \input) are here: http://pastebin.com/g1gt3UUq and here: http://pastebin.com/YNv9K3X3

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.