Tuesday, March 10, 2015

Failure logs can earn and cost money

What a lovely morning. Discovered a line that was costing me money. It goes something like this:

Main.WriteLog("/mistake/fails.txt", "item nr. " + itemnr, false);

This line is worth millions in both ways:

1. When you develop application, this line helps me see the problems when something is not working. I put it on several places in my code and examine the results in the named text file. Sometimes it makes me see the problem in seconds that would take 3 days to notice otherwise.

2. When website is online, this line costs time. Especially if youre amateur enough to leave it there and run it on big dataset so it goes through several times. Every hit means writing to disk. And writing to disk is a costly operation.

So you can imagine that this line is about to change to write to database. :-) Or perhaps having additional option to write to disk or database. Sometimes the function behind happens to be rather useful for other reasons as well.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.