2012-01-25 Increasing performance on my homepage 7 years ago
On the bottom right of my homepage is very small print with the total time taken from the start of the script to the end. I hadn't looked at it myself in a while but I noticed the total time had gone up to 0.55 seconds, which is a bit much. So I started looking where all the time went. The first problem area was the twitter feed: I parsed the (locally stored) twitter rss feed on each go and found out that took a bit more than 0.2 seconds. I guess XML::RSS parsing isn't too fast. I moved the parsing to the script which fetches the rss feed and moved the data to a postgres table, that saves quite some time. The next time saver was a new index on the table which links the newsitems with the tags. That saved another 0.2 seconds. There is still room for more speedup, but this is a nice start, processing times are back to 0.14-0.15 seconds. A bit more time was shaved off by showing less news items on my homepage. I write a lot longer news items now in 2012 than I did back in 1999.