Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

chromatic (983)

chromatic
  (email not shown publicly)
http://wgz.org/chromatic/

Blog Information [technorati.com] Profile for chr0matic [technorati.com]

Journal of chromatic (983)

Friday August 08, 2003
01:47 AM

Fast and Good, Pick Two

[ #13988 ]

One of my long-term goals has been to speed up Everything, the engine that runs Perl Monks, Everything 2, Animefu, and the Perl Foundation donation site. While half of those sites are using the 0.8 branch, the engine has improved immensely in the 0.9x track leading to the current 1.0 prerelease series. It's also become slower.

When I worked for EDC, back when anyone still worked at EDC, my biggest coding project was working up a scheme that cached compiled code from the database. Two years later, it's held up fairly well, in the sense that it does the job and I can still hack the code.

While there are lots of ways to improve performance, from improving some of the SQL queries to improving the node cache, I've focused lately on preloading code. To do that, I had to (with no small glee) bypass some of the nastiest code in the system, a custom class inheritance scheme. That does get rid of some run-time flexibility, but one of my roommates gave me an idea to get it back.

It took a few hours of spare time to get the system in order before I could start with these improvements. Now that it's mostly in place, writing the preloading code for another nodetype (think "class") only takes a few minutes. There are invariably a few bugs to track down, as the calling conventions tend to suck (due to early design decisions). I can clean those up soon.

Most of what's left is refactoring away a lot of duplicate code added through this exercise. The design is emerging pretty clearly now, and I'll be able to move more quickly with less code. It's nice to be able to remove several lines of code from a method, retaining the same behavior while saying it more succinctly.

Backwards compatibility is a concern, so I have to tread more lightly than usual. Still, I think the experiment is paying off. Hopefully we'll have a lighter-weight and faster Everything soon.

Ideally, we'll be able to use it on customer projects. We'll see.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.