On the performance of “Opinionated Builders”


I was reading Eric Hexter’s post titled “Opinionated Input Builders Part 6: Performance of the Builders” and I was going to leave a lengthy comment, but decided it would be better as its own blog post:

I’m going to assume that the data is all correct (or representative of reality). As another reader pointed out, this [poor performance] could simply be because debug=true is set in the web.config or some other non-obvious, but simple explanation. For this exercise, let’s assume that this performance is the correct reality.

Since [Eric’s] approach is very opinionated and conventional, I would expect it to result in very consistent and expected results (code written in the same way, files in the same place, etc).

This consistency is key because you could write some sort of pre-compiler that could inline the partials or something before pushing to production.If there isn’t already a tool to do this, I would imagine it wouldn’t be that hard to write.

“But now I have to write a tool to do what ASP.NET could do for me already!  This input builder stuff just ain’t worth it!” a skeptic might say.

But consider this:  Doing it WITHOUT input builders may slow you down 20% vs. doing it WITH them (I’m just making numbers up here, but you get the point).  Over an 8 week project with 4 people (1280 man-hours), that’s a savings of 256 man-hours.  I’m pretty sure that you could easily write some sort of in-liner or pre-compiler in 256 man-hours (6.4 man-weeks) and you’d end up with either a net-zero or a net-gain on the project.

I’m of the firm belief that you do what’s expedient for the project (YAGNI unless you’re absolutely certain you WILL NEED it), and deal with performance issues later in a systematic way.  Performance problems are always easier to deal with later and with more data from which to make a better decision and especially so if you’re consistent and conventional in your development (which Opinionated Input Builders certainly are).

So for those who might immediately turn their noses up at Eric’s posts due to suspected performance issues, I suggest you at least give it a second look or give it a little time as an optimizer might show up later, negating most if not all performance issues.

Some quick updates