-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call inkscape --shell with batches of files for faster processing #52
Comments
Well, maybe something to consider. Although, I am not sure, if it is worth the effort as this would only speed up the first compilation. The Inkscape export is only invoked, if a SVG file is newer than the resulting PDF export or the latter is missing at all. Once PDF files were generated, those are exported again only if the corresponding SVG file was updated in the meantime. |
On one of my larger projects, a standard compile takes me 54 seconds on the first run, and 37 on the next, so Inkscape slows things down by ~17/54 seconds. So Inkscape's extra time is between 1/3rd and 1/6th of the total time. It'd be nice to cut that in half, but anything less than half the time improvement doesn't seem like it'd add much that's noticeable. |
I will have a look at this for the next version once I find some time. Unfortunately, this is more of a long-term issue. |
I have to benchmark/profile this on my own. On my PhD thesis, a compile-from-scratch (3 passes, A few years back (~2018), when I was using a Makefile-based approach, individually converting a dozen figures or so with Inkscape took a substantial amount of time compared to batch-compiling everything, maybe 1 minute less out of 3 minutes. I am motivated to speed up initial compile time as it sometimes times out in Overleaf, and it appears that subsequent compilation runs restart from scratch if there was a compile error (or so it seems). Here's a small benchmark with all the
It's only one minute less during the first compilation, but that may be worth it, especially for more complex cases. In this case, it's much more than a 50% improvement, it divided the time by ~5 (one fifth the time). So quite noticeable. |
I am not sure how doable it is, but I would prefer the package to assemble a list of all svg files and call inkscape only once in batchmode, to convert all the files in one invocation. This is typically much faster than one invocation per file.
The batch interface changed a bit recently. This is what I do to convert pdf to svg with the current (1.2.2) version:
(yes, I could have bash variable text substitution, but I think calling
sed
is more portable?).export-latex
can be used as well.This could roughly results in the following sequence:
For reference, I used to do the following
pdf->svg
conversion in a Makefile with an older version of inkscape:But I'm not sure it's worth it to support older versions with a new feature.
If it's not possible to do so (if files need to be passed to the pdf engine right away), I suggest adding an option to allow skipping graph generation on the first pass. Ideally, placeholders of the right size should be created, but I am not sure this is possible either.
I don't mind compiling once more, personally (currently, I run a first
--draft-mode
compilation anyway, plus ~3 others), especially if it leads to much faster compile times overall.The text was updated successfully, but these errors were encountered: