Skip to content

yeah, another webcomics directory post

So I think I’ve worked out a nice new way to implement the webcomics directory. It’s going to be class-based, instead of function-based, and I’m going to start exploring the uses for mySQL in PHP instead of reading everything from flat file formats. In the end, if all works out right, it should look exactly the same, because I’m happy with the formatting, but there should be one major difference: every comic should load properly.

I think that one of the main benefits of handling it in this class-based way is that I can create subclasses whenever necessary, which means that I can handle all the really funny-formatted comics properly. Right now, I’m thinking of Demonology 101, which currently isn’t even in the directory because (1) it only updates once a week, and (2) it has a format so alien to the current directory structure that it’s impossible to parse.

Of course, one thing that I’m going to have to watch out for is load time. Already, it takes upward of 30 seconds to generate the webcomics directory, though most of this is because it has to load at least the index.html for each comic in the directory to give it a shot at parsing. With the new code, I can only increase the overhead processing time on the server, because I’m handling things at a higher level. One thing I want to attempt to combat that is to multithread the process, so that each call out to a foreign server happens (relatively) simultaneously. Of course, that would make this my first multithreaded program ever, and I’m not looking forward to it; everything that I’ve heard about it makes it sound hairy. Also, this would realistically force me to buffer all output until all the threads are finished processing, at which point I’ll need to flush everything… hopefully this’ll all happen fast enough that I don’t run into time-out errors on the client side…

For the moment, I’m going to be putting all my test implementations here, in case you want to see a buggy work-in-progress.

Of course, this means that I’m going to have to teach myself SQL in general, the mySQL implementation in PHP, the way PHP handles classes, all about multithreading… I think that’s all I’ll have to learn, for the moment, but I might discover more once I start coding.

Wish me luck!

RSS feed


No comments yet.

Sorry, the comment form is closed at this time.