Many people who have visited the photo gallery have remarked that it is rather slow. I have found that to be the case also, so I have placed a greater emphasis on performance than on UI tweaks for my next release of the gallery. Much of this work is (of course) database related. I have found that the most likely performance issues are these:
- Database indexes
In my rush to get the gallery up, I did not create the indexes that I should have, so the stored procedures are not as fast as they could be. This isn’t a huge issue at the moment, though, since the database just isn’t that big – none of the gallery tables even have 1000 rows yet. - Object model
I believe that one of the biggest bottlenecks in the application is an internal design flaw of my object model. I won’t get into the nitty-gritty details of the design, but when a user views a picture there are some unnecessary stored procedure calls that are occurring. And, some of these calls are occurring within a loop to populate a collection. Suffice it to say, that is negatively impacting performance when viewing a picture. I have improved this greatly within the latest code base so that certain stored procedures return multiple resultsets when necessary, and now there are no calls to stored procedures within a loop. I have not quite gotten to apply these breaking changes with the asp.net code yet, but when I do I am sure that there will be an improvement in the performance. - Size of the pictures
A lot of the pictures are high-quality jpeg’s. I thought they were reasonably sized for the "snapshot" view, but there is a chance that they still are a little big (size-wise). On a related note, I am using handlers to display the snapshots and the original pictures, so there is a chance that may be a slight problem as well, although I don’t think that causes any real additional slowness. I will recheck this after fixing the first two issues. - My webhost
I have been using webhost4life for the past few years. They have never had great performance, but considering the nature of my sites and the price I have been paying, it has been acceptable. I have noticed that this blog doesn’t always have great performance either, so I am certainly considering that the host may be part of the negative performance. I am locked up with them until next summer (unless I want to lose the prepaid amount), so I won’t be switching quite yet. Again, I am going to monitor this after the first two issues are resolved. I know they aren’t the best host out there, but I’ve been pretty happy with them for the price I pay. I’m not about to drop any more money than I already do just for better performance for a personal website. I really don’t get the traffic to justify it, especially since this site generates no income for me to pay for the increased cost.
With all that being said, I have been spending some of my evenings working on improving the gallery. I do hope to get a new code release soon. I was going to rewrite some of the UI elements and release the gallery to this domain, but I think I will do a performance release and only put it on the VanJon domain. I will inform both of my readers once it is done.