Feature Creeper   Leave a comment

Would be a better job title.

Wednesday (the 9th – I’m getting the hang of this) was a productive day at work. I’d done a bit of benchmarking after noticing my software was really rather slow at start-up. And no wonder; it was sucking down megabytes of data. Running on the same machine as the database, or over a LAN, that had never been a problem; a second or two at startup is barely noticable, and nobody had complained about speed, so I’d not had cause to look at it.

But now I had cause, and so I wondered what on earth it was grabbing. The whole database is less than a hundred megs, after all. And this meant I needed to add something that, in an ideal world, I would have added at the very beginning of development. Unfortunately, when you’re only starting development on a small program to do one simple thing, you don’t make the same decisions as you would when starting development on an all-encompassing monster of a system. And I did not know, back then, that when you start work on one tiny little thing, it will inevitably evolve into a monolithic monstrosity of terrifying proportion. After all, if that’s what they wanted, they’d tell me. Right?

So I’ve wound up with an all-encompassing monolithic monstrosity of terrifying proportion that contains no debug logging. Happily, of all its deficiencies, that’s one of the easiest to rectify; less than a dozen lines of code later and it can log debugs. Hurrah! But it’s a lot more work to actually make it record anything; Visual Basic 6 contains diddly-squat in the way of… Oh, any kind of useful feature, really (it’s dead quick and easy to knock together a simple program to do one little thing, but less useful if… Yeah), so if you want a function to log anything, you have to add a debug call manually. For every function that you care about. Fortunately, I mostly care about the things in the util library, so it’s not much work to get it to tell me everything it asks of the database, and how many records and fields are returned (and this also confirms that Recordset.Count is no longer always 0, so we can finally use that rather than count records manually with a loop. A small bonus, but a welcome one), so we can soon spot where I’ve done stupid things. Or even worse, where I’ve done stupid things more than once (usually thanks to event handlers. Thanks, event handlers!).

And that meant I quickly chopped megabytes off the startup database accesses, which should make everybody’s life better. Hurrah! My greatest success so far was cutting a recordset of fourteen thousand records down to six. Not six thousand, six. When I’m stupid I’m stupid really hard. Chopping several 5,000-record sets of 80 fields each down to two or three fields also helped a great deal. Asterisks are not your friend.

The rest of the day involved going to the gym, and finally caving in and buying Rage when SavyGamer reported the fancy-pants edition for £14. Because I’m really short on games at the moment, as has been mentioned before. Oh, and baked beans and mashed swede and carrot for dinner. Healthy, but tasty.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s