UI Times vs. DB Times

time to read 2 min | 259 words

Just something interesting that I noticed when fixing some things in NQA.

I've added performance measurements and I got strange results, I was getting bare database access times that were longer then the NHibernate times.

That didn't feel right, I wasn't doing anything very serious, but I knew that NHibernate must be doing something, and that meant that there had to be some overhead. Certainly not the other way around.

When I took a look inside I discovered that I was timing UI updating as well. [Yes, this is bad, but that was the fastest way to get the code done at the time.] I refactored it a bit, so now it pulls all the data from the database first and measure only that.

The interesting thing is that the times went from ~900ms to ~250ms. Perhaps I'm very inefficent in my UI (likely, even) but my conclusion1 from this data is that the UI is very slow. Has it been your experiance as well? {I was updating a ListView, btw}

1This is based on one case only, so don't take it too seriously. It may be that I do inefficent things in the UI.

"Never violate the Prime Directory! C:\" -- Tech Support Slogan

"Someday we'll look back on all this and plow into a parked car." -- Bumper Sticker

"Strange is our Situation Here Upon Earth." -- Albert Einstein