reedmaniac.com

Talking About That Which I am Slacking On

I am supposed to be coding up a set of Data API libraries for ExpressionEngine 2.0, but I am just feeling the urge to slack off. Tends to always happen around mid-afternoon every single day. Also, in the middle of the morning. Early morning too. Ah, who am I kidding, I am just a slacker. The only time I do not feel like slacking off is usually after 1 a.m. Because, if I am up that late I am really deep into the project and enjoying myself.

The Data API libraries are supposed to be an abstracted way of doing fairly common things like creating content and manipulating the structure of the data in the system. Right now, for example, you can create a weblog entry in about four different places in the program. Just so happens that because of how EE developed instead of having a single method to call for all four places, we have three. Incredibly inefficient on a code level as a single change in entry submission might need to be done in triplicate.

While making these libraries, I am effectively copying and pasting code, reviewing it, and realizing how absurdly old and out of date some of this code is. Typical me, I just rewrite it from scratch and hope that I am not introducing any new bugs. Becoming amazingly knowledgeable about using the Active Record system in CodeIgniter while doing it too. We need to expand AR even more, as there are things it cannot do that I want it to do. Our to do list is always seemingly gaining more items than it loses. Picky developer am I.

So picky in fact that I spent over a week rewriting parts of the Template and Typography libraries to make them more efficient. Would you believe that I found a way to optimize the processing of weblog entries that potentially makes ExpressionEngine nearly 30% more efficient in its PHP processing of a template? Using just three or four lines of code too. After that week of work, ExpressionEngine 2.0 is approximately 37% faster processing my test data than the original release of ExpressionEngine 1.6.3. Probably even faster on templates heavily using the Weblog Entries tag. Should be pleasing to a few people.

Sadly, the new methods for processing tag variables ended up not being the little speed demon we had originally hoped. Essentially, the module itself will organize and structure the rows of data while these new methods do all or most of the processing of variables in the tag's data. In our few trials it has reduced some of our modules' tag processing code by half. One of my goals for EE 2.0 was to increase the amount of abstraction in our code to make things easier for future development. The curse is that the more things you abstract and pass off to higher functions, the less you can really optimize and make things specific for certain tags. Adds a bit of a general overhead in processing. Thankfully, with caching and clever coding, it is only slower by a couple percentage points, which I think is worth it for the great reduction in memory usage and code complexity.

And to think, it is only April...
– Wednesday, 2008 April 16 @ 1:00 PM | 3 Comments -
  -