Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I always thought that PDFs and PostScript files are quite similar, even though PostScript is a turing complete language.

Is there a reason PostScript is a lot slower when rendering (tried with evince on Ubuntu) than PDF or are the reader just a lot less optimized?

share|improve this question
add comment

3 Answers

PostScript is a programming language.

PDF is a document format.

Because PostScript is a programming language, the entire contents of the document must be computed step by step. While PDF supports a limited subset of PostScript for vector graphics, it is designed specifically as a document format and does not require this sort of computation.

share|improve this answer
add comment

But most importantly, PDF works page-wise: each page is mostly a self-contained entity, so you can skip to any page and the reader can start rendering that page immediately.

A PostScript document, instead, is a single big program, which means that the PS viewer has to execute it all the way to the page you want before being able to display it correctly.

Also, PDFs contain objects to be rendered, while PostScript is a programming language that instructs a renderer to draw such objects, thus PDF is, in some sense, pre-digested compared to PS, and thus quicker to interpret.

share|improve this answer
add comment

I've no way to currently check if my assumption is correct -- but here it goes anyway:

I suspect that evince cannot directly render and display PostScript on screen. Maybe it can only do so for PDF. So it may use a trick for PostScript files: behind you back it converts them to a temporary PDF file and display that one instead.

Try to install the (very old-fashioned) gv PostScript viewer on Ubuntu:

 sudo apt-get install gv

and then

 gv /path/to/PostScript.ps

and see if it is any faster. (gv also uses PostScript for rendering, but doesn't convert to PDF.) Or you use Ghostscript directly

 gs /path/to/PostScript.ps

But don't forget one thing: exactly because PostScript is a programming language, you can design PostScript files which are rather short in Bytes, but make the interpreter go through a loop with thousands of iterations (for example to compute + render a fractal) before it displays the file content on screen.

PDF doesn't have 'loops' and computations like that...

share|improve this answer
    
Here's a fractal in PS, which contains an infinite loop producing endless pdf pages. 3.1K produces 10's of Megabytes per page (too much for my Kindle). –  luser droog Sep 14 '13 at 7:11
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.