Hi,
On my way I'm only indexing differents html pages that are not necessary linked together.
It seems, as you said that the optimization phase is done only once ... but ...
What I can suggest to you
Sol #1) Try to comment the optimization phase and have a look to the result ==> 5 minutes
Sol #2) Use the phpdigTimer class to profile the source or use other profiling functions such as
http://www.pear.php.net/package/Benchmark. ==> 1 hour
I thing that you can quick discover where from is coming the trouble quite quickly (1 hour) and afterwords to fix it.
Regards,
Thierry