Site Update Progressing

On the heels of announcing that I was going to redo my site, I got a notice from my host that I had gone over my bandwidth allotment. Therefore, in addition to my other goals, I added “making a leaner site over all.” So I took some inspiration from a few sites and came up with a site that comes in 50% – 60% leaner than the current design.

In order to come up with the site, I went to my usual inspiration sources. I went to css Zen Garden but nothing grabbed me. Then I went to Web Design from Scratch’s Current Web Style rundown. (Cool site, by the way, and runs on CFML.) From there I was going to go with a design inspired by Carlos Cabera‘s site, but I couldn’t quite get inspired without outright stealing, so I had to ditch it. Then I saw Riding Rails, the blog dedicated to Ruby on Rails. I really like that strong logo, and minimalist design, and decided that I liked that, and could emulate without stealing.

The other thing I decided to do was use the new fonts from Microsoft that are going to be part of their next set of software releases. Now I know it is a little too early to be using them, but I just couldn’t resist. I think you can still find them out there in the wild if you know how to search for them. I have to say, I really like the way the new site looks in them.

By the way, the whole bandwidth thing happened not because I had a surge of popularity, but rather because I got slammed by some MySpace users directly linking some of my odder pictures:

Changes are a-coming

It’s been close to 9 months since my last site redesign. Obviously, a redesign is in order. However this time, I’m going to approach it in a more professional manner. I’m going to define goals ahead of time and see if I can come up with a plan to reach them.

First off, I should define the overall goals of my site, which are

  • To practice techniques across the spectrum of web technology , particularly those that my fall outside the realm of my current professional responsibilities.
  • To practice blogging specifically.
  • To give me an excuse to keep up with one of my favorite hobbies including politics, writing, and cigar smoking.

Now for the goals of my upcoming redesign:

  • To practice creating another aesthetic look for a web site.
  • To unify site navigation
  • To further de-divitis my XHTML
  • To experiment with DOM scripting in a manner consistent with the separation of content, presentation and behavior extolled by the Web Standards Project.
  • Possibly style sections of the site that are specific with a specific look. (Cigars, technology, politics, etc)

Who knows when I will get this done, as I’ve got a wedding to go to this fall, and some prep work to do for it. But I wanted to get that out there so I would remember to do so.

Hiring in Philly Again

The Wharton School is hiring web developers again. I’m not the one doing the hiring, but I can get you in touch with those that are.

The position itself is for a ColdFusion/SQL Programmer with Flex work a possibility. Experienced web developers without knowledge in those areas will still be looked at though. (Considering that ColdFusion is pretty easy to learn when you already know how to program.)

All applicants must use the University of Pennsylvania HR system to apply. The referral code for the position is: 060118931. However if you are interested feel free contact me and I’ll get you in touch with the hiring officer.

Empirical Testing of Custom Tag vs. CFC for Output Part II

I got a bunch of comments on my previous post: Empirical Testing of Custom Tag vs. CFC for Output. A few of them stuck with me and so I went and tweaked my trials.

First Ray Camden pointed out that there’s more to consider than just performance when evaluating coding practices. He is completelyright in that point and I completely agree. However I was interested in whether or not there was more than just a stylisticdifference between the methods (output using Custom Tags versus using CFC’s) I was exploring. One of the attributes I was looking at was performance.

But Sean Corfield pointed out that maintainability was the chief attribute that leads him to prefer Custom Tags. Specifically, that CFC’s couldn’t be easily edited by traditional web designers. I buy that. .

Sean then went on to point out that my number didn’t match what he was able to get on his laptop. Under his tests with Trusted Cache turned on, he was able to get Custom Tag performance to match CFC performance. I went back and noticed that my “production” instance didn’t have the Trusted Cache turned on. So I reran the tests with Trusted Cache enabled.

Finally, Mark Fuqua pointed out that I wasn’tusing a realistic output function. Specifically, it just dumped the letter ‘h’. So I created a simple navigation <ul$gt; and the code encapsulator disables the link for the current page. I then added an element of random selection for which navigation choice would be deactivated. (This will make more sense if you look at the code.) .

Results

I had to up the number of iterations to 10000 to tease out a difference. As you can see, the difference is negligible.

Figure 1. Results of CFC comparisons on Production servers with the Trusted Cache Enabled at 10000 Iterations
Methodology Average Time (ms)
CFC Invoke from Memory 306
Custom Tag 391
CFC Direct Invoke 2200

So then I tried 10000 iterations with the Trusted Cache Enabled, and presenting a navigation list.

Figure 2. Results of CFC comparisons on Production servers with the Trusted Cache Enabled presenting a realistic interface at 10000 Iterations
Methodology Average Time (ms)
CFC Invoke from Memory 766
Custom Tag 965
CFC Direct Invoke 2611

Conclusions: Okay there are still slight performance differences, however to see them you have to iterrate over them 10000. I’m not convinced that they are really significant in that case. So don’t go out and rearchitect just yet. However, now that I have a better understanding of why one would choose Custom Tags over CFC’s I’m sticking with my method.

Source Files: If you would like to reproduce my experiment, please feel free to give it a try, it’s been updated with new code for a the navigation interface: Source Files

Empirical Testing of Custom Tag vs. CFC for Output

This is one of the drier posts I’ve ever written. And I’ve written some dullards. If you start to fall asleep, look at the pretty tables.

It is recommended to use CFC’s for “business logic” encaspulation, and leave UI encapsulation to custom tags. This is based on what we’ve read out on the Adobe Blogs about the subject. There’s one problem with that I dislike custom tags. I have no reason for it. I could argue that I prefer a few large files as opposed to many small files. This is probably why I jumped onto CFC’s so quickly.

Consequently, I’ve been doing UI encapsulation in CFC’s. Specifically, I put all of my reused UI components (headers, footer, navigation menus) in a single CFC named “interface.cfc.” I then push that to the application scope, and call it from there. I will totally own up to the fact that this is my personal preference.

However at a code review, my coworkers and I got into a discussion of the pro’s and con’s of using such a memory resident ‘output’ CFC . The discussion of to Custom Tag or CFC came up again. At the end of the discussion, I was willing to leave it at “It is a stylistic concern and not a performance based concern. ” But frankly, that was based on what I knew about CFC execution and gut feelings, but certainly not hard facts. So I decided to do some performance tests.

I created a custom tag that outputted the letter ‘H’ with no markup. I created a CFC with a method named test, that outputted the letter ‘H’ with no markup. I then created an index page that would loop through both calls the same number of iterations, and record the length of time it took to loop through the calling method at that iteration count. I tried three different methods:

  1. Straight Custom Tag Call
  2. Invoke on an CFC directly
  3. Invoke on an CFC that had been placed into memory as an object.

My hypothesis was that method number 3 would be the fastest performer, but that it wouldn’t be an order of magnitude thing, just a percentage thing.

Figure 1. Results of CFC comparisons on Development servers at 10 Iterations
Methodology Average Time (ms)
CFC Invoke from Memory 23
Custom Tag 33
CFC Direct Invoke 68

My first test upheld the hypothesis, but the differences there were pretty small so I fooled around with the number of iterations until I found one that ran quickly, but still showed clear patterns. The number I came up with was 1000. Below that it all method were too fast to see any difference.

Figure 2. Results of CFC comparisons on Development servers at 1000 Iterations
Methodology Average Time (ms)
CFC Invoke from Memory 2313
Custom Tag 4272
CFC Direct Invoke 5542

That continued to uphold my hypothesis. However, I was running it the code on a development server. There are differences between the performance of development and production servers. Debugging information gathered on our development servers tends to slow down CFC method execution. So I ran that same iteration test on a production-configured instance of ColdFusion that sits on our development server. It has debugging turned off. Other than that there is no difference, same hardware, same memory allocation. Here are those results.

Figure 3. Results of CFC comparisons on Production servers at 1000 Iterations
Methodology Average Time (ms)
CFC Invoke from Memory 39
Custom Tag 1262
CFC Direct Invoke 2649

That’s not a typo. On a production-configured machine CFC invocation from memory will run in about 3% of the time it will take Custom Tag execution to occur even for output components.

I figured I’d share these results and see if I’m on to something, or did I miss something major in my methodology. Does this change anyone’s mind on using CFC for output?

Source Files: If you would like to reproduce my experiment, please feel free to give it a try: Source Files

Adobe and Webstandards

There’s an article on Adobe/Macromedia’s Developer’s center about supporting Webstandards, exhorting us to develop with them. As far as I’m concerned they’re preaching to the choir. However, I wonder if this means that the company will get behind Webstandards for their products. I’m looking at you ColdFusion.

Now, for the most part, it is very easy to write Webstandards based HTML/XHTML with ColdFusion. That is as long as you aren’t using Flash Forms, or <cfchart>. Basically anything that embeds Flash uses the backward compatible Flash embedding, and <cfchart> even in .jpg or .png mode still creates image embedding code that isn’t Webstandards compliant.

I understand the need to balance the ideal of Webstandards compliance against actually working with the browsers that people are actually using. But can’t we have a boolean on those tags that embed content that developers can use to choose for themselves to support old browsers. Maybe we could even pass in a HTML/XHTML version to comply with.

Not that I don’t love the work that the ColdFusion development team has done, but Adobe brought it up. And this isn’t the first time I’ve said this: ColdFusion and Valid Code.

Alternative to CFLDAP

I’ve been working on a project that required line by line processing of 38,000 records. Each one of those lines required a ldap query. This eventually caused the LDAP calls to fail, as each <CFLDAP> call was incurring an unclosed connection, and the pool of the local server was being filled.

<CFLDAP> has no ability to manipulate the connection like you can with <CFFTP>. Therefore I needed to find a way of controlling the connection. Eventually I stumbled onto Dave Ross’s site which had a lot of information about using JLDAP with ColdFusion.

Using the information there I built a CFC that uses JLDAP to manipulate ldap like <CFLDAP>. Hopefully, it can be of use to someone else out there.

JLDAP in ColdFusion

Wikipedia Showdown – Flex 2.0

Inspired by Ben Forta’s appearance at PACFUG, I decided to Flexify an application that I originally wrote as an experiment: the Wikipedia Showdown. It didn’t take that long to write in Flex 2.0. Most of the time was spent fine tuning the position of of the elements and what not. Check it out, I should post the source in a day or so.

Wikipedia Showdown Flex 2.0.

Note: Make sure you have the Beta version of the Flash 8.5 Player otherwise it won’t work.

CFC’s, WSDL, and Whitespace

I ran into an odd issue this week, and figured I share. I was getting errors when trying to access a CFC as a webservice from another machine. When I actually browsed to the url of the cfc with the wsdl switch I got an error message that the XML was malformed. I examined the source of the wsdl I found a bunch of whitespace.

This cfc actually exists on all of my ColdFusion servers (15) half of which were the same version and patch level, and one that was cloned two weeks ago from the same source as the server having a problem (also cloned two weeks ago.) I checked the copy on all of them and no error, and no whitespace. I checked the ” Enable Whitespace Management” setting, which was enabled on all of the machines, and the malfunctioning server. So no joy.

I added <cfprocessingdirective supresswhitespace=”TRUE”>… Still no joy. Finally I added a <cfsilent> which did the trick. Very strange. Odd that it only effected one server.