Since I am using biber, the compilation time for my document has increased dramatically.
It's a dissertation with <300 pages and a full latexmk
compilation suddenly needed 26 minutes which is not acceptable IMHO.
I already read, that biber
might be slower than bibtex
(see https://tex.stackexchange.com/a/53302/4009), but can it really make such a difference?
I already described the problem here (https://tex.stackexchange.com/a/230749/4009 ) and narrowed the problem down to biber
which seems to have a large impact on compiling time.
I use the following biblatex setup:
\usepackage[natbib=true, style=numeric-comp, backend=biber,
defernumbers,useprefix,firstinits=true, maxnames=99, maxcitenames=3]{biblatex}
My question
- Is
biber
really that much slower thanbibtex
- Can I do anything to still use
biber
but decrease compiling time? - It seems that it is not the
biber
run itself, that makes compilation slow, but usingbackend=biber
slows down pdflatex a lot - can I use other options (kind of a draft mode) to speed up biber and only use the slow compilation for the final versions?
Unfortunately, I've switched all my input files (.tex
, .bib
) to UTF-8 encoding, as I head problems with exotic characters and it seems to me there is no easy way back to the good old latin1
times. And it seems, that UTF8 requires the biber backend.
Test setup
- my LaTeX document, limited to one long chapter by
\includeonly
, - 98 pages with many many references, many of them in large tables.
- large
.bib
file (5.6 MB) with >3000 references, 350 of them cited in the document - I'm compiling from OS X terminal to measure the duration of the compilation:
latexmk -C; time pdflatex main.tex
Test results
with biber:
- biber cache removed once with
rm -rf `biber --cache`
-
latexmk -C; time pdflatex Diss.tex
Output written on Diss.pdf (83 pages, 2130562 bytes).
real 2m17.499s
user 1m47.626s
sys 0m1.030s -
biber Diss
real 0m27.257s
user 0m20.568s
sys 0m1.247s -
pdflatex Diss.tex
Output written on Diss.pdf (95 pages, 2453607 bytes).
real 4m7.708s
user 3m27.864s
sys 0m1.029s -
again
pdflatex Diss.tex
Output written on Diss.pdf (95 pages, 2452370 bytes).
real 4m33.769s
user 3m36.491s
sys 0m1.252s
with bibtex8
- remove all
aux
andbbl
files etc. latexmk -C; time pdflatex Diss.tex
Output written on Diss.pdf (82 pages, 2130383 bytes).
real 0m48.470s
user 0m19.161s
sys 0m0.522s- time
bibtex Diss
(There were 200 error messages) sure 🙁
real 0m1.258s
user 0m0.850s
sys 0m0.061s -
time
pdflatex Diss.tex
Output written on Diss.pdf (95 pages, 2452225 bytes).
real 2m26.433s
user 1m44.921s
sys 0m0.932s -
second
pdflatex Diss.tex
Output written on Diss.pdf (95 pages, 2450936 bytes).
real 2m27.148s
user 1m51.958s
sys 0m0.953s
My .biber.conf
path: ~/.biber.conf
<config>
<sourcemap>
<maps datatype="bibtex" map_overwrite="1">
<map>
<map_step map_field_set="Annote" map_null="1"/>
<map_step map_field_set="Abstract" map_null="1"/>
<map_step map_field_set="Keywords" map_null="1"/>
<map_step map_field_set="comment" map_null="1"/>
</map>
</maps>
</sourcemap>
</config>
- Is this ok?
- Are the field names case sensitive?
- is something missing here?
Test 2 with example document
I set up an example document using the biblatex-example.bib
file included in TeXLive 2014
. For details please see my answer below , as it seems to crash the question, if I insert that much text here.
The sample document compiles 80% faster with bibtex
!
Maybe you want to try it on your machine and see how long it takes?
Best Answer
General Test setup for performance comparison
I've set up a test file which uses the
biblatex-examples.bib
References included inTeXLive 2014
. It cites each reference 10 times (not very elegant, but it works).Results:
with
biber
backendwith
bibtex
backendbackend=bibtex
(still each source cited 10 times), the whole script needs less then 18 seconds - this is 80% less than withbiber
!!further tests:
\nocite{*}
instead of citing each source separately reduces the time with biber to 21 sec!Compiler scripts:
run:
time compile-bibtex.sh
run:
time compile-biber.sh
LaTeX source code
BiberPerformance.tex