« Good News, Bad News | Main | 魔法騎士レイアース2 (Magic Knight Rayearth 2) Vol. 3 »

After that scare with the script taking too long to re-generate this site, I decided to go inside the code to see what I could do to speed it up. It turns out that there was a huge bottleneck in sorting Japanese text with Perl's Unicode::Collator. A little caching using some hashes did the trick so it didn't have to generate a new sort key everytime it needed to do a comparison. It took more than 55 seconds to generate the site before, I nailed it down to about 30 seconds now. It no longer gives me a timeout error.

In addition, with the savings in time, I implemented a little counter underneath each section in the manga listings. It now shows the number of books for each hiragana grouping. Hmm...most of my books fall in the "ka-ko" group.

I guess I don't need Moveabletype 3.1 after all and can postpone upgrading until I max out the server again.


Comments

(Comments are Closed)

Lunar Scribbles