statedecoded icon indicating copy to clipboard operation
statedecoded copied to clipboard

Exporting static files to downloads is absurdly slow

Open waldoj opened this issue 9 years ago • 6 comments

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.

waldoj avatar Jul 17 '16 01:07 waldoj

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.

waldoj avatar Jul 17 '16 18:07 waldoj

You'd probably be best off using Xdebug to profile this.

krusynth avatar Jul 17 '16 18:07 krusynth

I keep meaning to learn to use that. I guess this is the occasion. :)

waldoj avatar Jul 17 '16 18:07 waldoj

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.

krusynth avatar Jan 15 '17 02:01 krusynth

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.

krusynth avatar Mar 19 '17 19:03 krusynth

Oooh, good thinking!

waldoj avatar Mar 20 '17 02:03 waldoj