I don't know what causes the gradual slowdown. My assumption was that it was the "optimize" which would cause the index to be built, so I didn't expect a slowdown at all during "add" calls, especially when autoflush is false.
The xml file name is a hash of the contents, and it is placed in a path such that the export spreads out the files nicely into a file system tree, rather than putting a million docs into one directory.
<record>
<priref>20412518</priref>
<current_location>FTA</current_location>
<current_location.type/>
<description>Ingang op de binnenplaats van de zuidvleugel</description>
<collection>Fotocollectie</collection>
<production.date.start>1925-08-06</production.date.start>
<reproduction.format/>
<reproduction.reference>2186abf4-7108-f9b8-ffbb-902881afe836</reproduction.reference>
<creator.role>Fotograaf</creator.role>
<object_number>9.387</object_number>
<monument.label/>
<monument.zipcode/>
<monument.record_number>284330</monument.record_number>
<reproduction.date/>
<reproduction.notes>Oude filepath: 0009\009387.jpg</reproduction.notes>
<reproduction.type/>
<reproduction.creator/>
<rights.type>Copyright</rights.type>
<technique>Neg.zw</technique>
<creator>Scheepens, W.C.L.A.</creator>
<order_number>avh04-2008</order_number>
<input.date>2008-04-01</input.date>
<edit.date>2011-05-03</edit.date>
<edit.date>2008-04-28</edit.date>
<monument.historical_address/>
<content.subject.type value="SUBJECT" option="SUBJECT">
<text language="0">subject</text>
<text language="1">onderwerp</text>
<text language="2">sujet</text>
<text language="3">Thema</text>
<text language="4">موضوع</text>
<text language="6">θέμα</text>
</content.subject.type>
<content.subject.type value="SUBJECT" option="SUBJECT">
<text language="0">subject</text>
<text language="1">onderwerp</text>
<text language="2">sujet</text>
<text language="3">Thema</text>
<text language="4">موضوع</text>
<text language="6">θέμα</text>
</content.subject.type>
<content.subject>Kasteel</content.subject>
<content.subject>Binnenplaats</content.subject>
<monument.province>Limburg</monument.province>
<monument.place>Hoensbroek</monument.place>
<monument.number/>
<monument.county/>
<monument.country>Nederland</monument.country>
<monument.house_number>18</monument.house_number>
<monument.street>Klinkertstraat</monument.street>
<monument.house_number.addition/>
<monument.complex_number/>
<monument.number.x_coordinates/>
<monument.number.y_coordinates/>
<monument.geographical_keyword/>
<monument.complex_number.x_coordinates/>
<monument.complex_number.y_coordinates/>
<creator.date_of_birth/>
<creator.date_of_death/>
<creator.history/>
<record_type value="OBJECT" option="OBJECT">
<text language="0">single object</text>
<text language="2">objet individuel</text>
<text language="3">Einzelnes Objekt</text>
</record_type>
<edit.time>03:10:32</edit.time>
<edit.time>11:17:08</edit.time>
<input.time>09:58:28</input.time>
<input.source>document>photographs</input.source>
<edit.source>collect>photograph</edit.source>
<edit.source>document>photographs</edit.source>
</record>
</narthex>