Add option to use Ghostscript API instead of forking
This is much more efficient than the current scheme when converting
many PostScript files, for example when building the documentation.
For the Notation Reference, lilypond-book now takes ~2m30s instead
of 5m to compile all snippets from the notation.tely file. Other
manuals benefit less, but still the time for 'make doc' on my system
improves by one third from around 33m to 22m.
An alternative would have been to always call gsapi_init_with_args
with the same arguments used until now. This indeed works and avoids
the overhead of forking, but the instance cannot be reused. Calling
gsapi_new_instance -> gsapi_init_with_args -> gsapi_delete_instance
for every conversion still means a lot of overhead and a prototype
suggested only a small gain compared to the previous solution.
This is not the default because recent versions of Ghostscript are
distributed under the AGPL and it's unclear what the implications of
linking to the library is. If built with support for the API, use
-dgs-api=#f to still fork the gs command.
Fails make
Did you regenerate configure? It should have complained about a missing dependency. On Ubuntu you need to install the
libgs-dev
package.Anyway after feedback from Han-Wen I will update the patch and guard this by an optional configure flag. So no need to re-test the current Patch Set.
Diff:
Add option to use Ghostscript API instead of forking
http://codereview.appspot.com/548030043
Diff:
add license information
http://codereview.appspot.com/548030043
Patch doesn't apply to current master
rebase + allow -dgs-api=#f to still fork
http://codereview.appspot.com/548030043
Diff:
Passes make, make check and a full make doc.
Patch on countdown for May 9th
Patch counted down - please push