Hi,

I'm currently in the process of converting a larger DocBook based
documentation system to Sphinx/rst.

I have hacked the doc2rst Script quite a bit, to support more of
DocBooks special stuff (the improved db2rst will probably be open
sourced again when i have ripped out the custom hardcoded stuff again),
that worked fine so far. But now i tried to convert XML entity
catalogues for shortcuts to Sphinx/RST and saw a quite disappointing
slowdown of the whole process.

I have an example project that contains 349 .rst and 222 PNG files after
the conversion from DocBook, the .rst files are typically 1kB-10kB in
size, with some going as large as 50 kB for a total of 920.000 bytes.

This creates HTML from scratch (no doctrees cached, no output files yet,
running on Windows Server 2k8R2, Core i5 750, 16 Gig RAM, Python 2.7.2,
Sphinx 1.1.3, doctools 0.8, all files residing on SSD) runs in 37 seconds.

Now i tried to add to my conf.py:

rst_prolog = """ .. include:: ../common/shortcuts.rstext

"""

The shortcuts.rstext file has 370 lines (around 10kB) of trivial
substitutions, mostly like:

.. |foo| replace:: `Foo`

Now rerunning the conversion from a clean state takes 251 seconds (!!).

(of course always running the test a few times to get stable timinings
and make sure everything is in the OS cache).

Of course, the size does increase by the includes, around a factor of 4
more text to parse due to the includes (349*10kB + 900kB), but the
slowdown is around 7x.

I tried what happend when the includes were smaller, just 3 kB (100
lines), and saw 74 seconds of conversion time.


Is there anything simple i can do to speed this up?
Some kind of pre-compiled header or similar efficient way to provide
common substitutions? Or would i need to write a sphinx plugin for
substitutions instead of using the standard rst substitutions?

Michael

-- 
Michael Schlenker
Software Architect

CONTACT Software GmbH           Tel.:   +49 (421) 20153-80
Wiener Straße 1-3               Fax:    +49 (421) 20153-41
28359 Bremen
http://www.contact.de/          E-Mail: m...@contact.de

Sitz der Gesellschaft: Bremen
Geschäftsführer: Karl Heinz Zachries, Ralf Holtgrefe
Eingetragen im Handelsregister des Amtsgerichts Bremen unter HRB 13215

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to sphinx-dev@googlegroups.com.
To unsubscribe from this group, send email to 
sphinx-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en.

Reply via email to