I've made a C++ program with uses a LaTeX template for creating PDF documents. I open the file, replace some placeholders written inside the .tex document with values of a DB, and then, I compile the filled document with pdflatex to get the corresponding PDF.
My .tex files are pretty simple: some packages (inputenc, fullpage and so on) and then a not specially long body (5 pages at most).
Since every PDF comes from the same .tex template, and they have lot of things in common (format, structure, headers), is there any way to precompile a .tex document in order to compile faster?