We had been getting complaints about the performance of TekTag a few months ago. Sometimes it was okay, sometimes it was really, really bad. Even stranger, though we had been growing, we hadn't been growing that much. So we wondered - what could it be?
We started by looking at the usual suspects. Something must be wrong with the network or the server, since we hadn't changed any significant functionality. We checked, but nothing there. Then we thought maybe it was a bad query that had slipped by. We did a bit of MySQL tuning, but still nothing. We'd read about the need for caching in apps like ours, but we didn't want to just try it. And then one of our guys came across the problem - domapi.js.
domapi.js is a cross-browser DHTML library for adding client side GUI features, commonly used for adding AJAX. We used it for only a few little things - the little ratings gears and some other stuff. But it seems that very frequently, when we generated pages, the browser would download a whole bunch of domapi.js components that we didn't need. So even though we had the page ready to go, the TekTag server had to wait until we finished downloading the remaining domapi.js components to the browser before rendering.
If you use domapi.js and are experiencing slow performance, look for a domapi.loadUnit ("ajax") call and check it out. Ours used to hang a lot, in addition to taking a long time.
I'm sure there are workarounds for this, and we're not saying never to use domapi.js. Just be careful and make sure to check it.
In our case, we used so little of the functionality, we just rewrote a few scripts and don't need domapi.js anymore. We also decided to start using SAJAX. Seems to be working fine.