Exporting static files to downloads is absurdly slow
Files are being written at the rate of about one per second. I'm not sure what the story is here (it's possible that it's something wrong with my server), but look into it.
We're just using file_put_contents() in the export stanza. There's no reasonable optimization to be done there. It's worth checking whether the delay is coming from how we iterate through all of the laws.
You'd probably be best off using Xdebug to profile this.
I keep meaning to learn to use that. I guess this is the occasion. :)
Without a clear direction here, I think optimizations of this sort probably should be moved to Future. This is slow, yes – but we're also cobbling together a lot of XML from strings inside of PHP, which is probably not the most efficient thing in the first place.
I've added a microtime timestamp to the logger so it should be easier to figure out what's taking so long. You can use logger->debug to generate additional messages as well.
Oooh, good thinking!