Coder's Revolution

Do you want a revolution?

Category Filtering: 'Performance'

SQL Server Temp Tables: When Do I Create My Indexes?

Performance, SQL
My last blog post was originally the start of this one, but I got so carried away talking about the different types of temp tables I split it off. Today's topic is when to create indexes on SQL temp tables-- before or after you add the data. Many people out there seem to hold the same opinion on the subject. I don't like taking other people's word and I also like doing things the hard way. Therefore I created a series of tests to see which way really was fastest.
Comments are currently closed

SQL Temp Tables

Performance, SQL
Here's a quick note about SQL temp tables. In SQL Server, there are three kinds of temporary tables you can use. The first kind (my favorite) are known as table variables. They only exist in memory and are not written to disk (unless your OS is low on RAM and starts swapping). Table variable names start with an "@" just like other T-SQL variables and the syntax for one is like so:
Comments are currently closed

SQL Server Performance: How Are My Indexes Being Using?

Performance, SQL
You may have a full-time DBA where you work, but a lot of us share the CF developer and DB developer hats. Your SQL Server's performance can be an easy thing to overlook if your database is very small, or your website gets very little traffic. The easy (but not always correct) answer to most performance problems is "add an index". Some indexes are an obvious help, but how do you tell if the less obvious ones are really being used? It is possible to have too many indexes. In addition to bloating the size of your database, they take time to update which can actually slow your application DOWN on inserts and updates.
Comments are currently closed

SQL Server Gotcha: Implicit Unicode Conversion

ColdFusion, Performance, SQL
A recent thread on CF-Talk brought up this very good topic. It deals with the performance hit you can get when SQL Server implicitly converts your data to nchar and nvarchar for you when you have enabled Unicode support in your data sources. Unicode text cannot be stored in normal char or varchar fields. It must use nchar or nvarchar. These data types use two bytes per character, which means you can only store half as much text in them (limit 4,400 instead of 8,800). The problem is two fold:
  1. SQL Server cannot directly compare a varchar and nvarchar value so it must convert one.
  2. String manipulation or conversion on an indexed column will render the index useless
Comments are currently closed

New Centuar Features Demoed! ORM, Bolt (IDE), Code Generation, CFScript

ColdFusion, Max, Object Oriented Design (OOP), Performance
I just got out of a session with Jason Delmore talking about some of the new features being looked at in ColdFusion 9. He mostly talked about the ORM features being baked into the next version of ColdFusion courtesy of Hibernate. We also squeezed a few other tidbits of information out of him too.
Comments are currently closed

MSSQL's openquery Saved Me

AS400, Performance, SQL
Sorry I've been quiet for the past few days. My Flex adventures took a quick detour through the massive land of our AS400 and DB2. Now that I had a prototype of my pretty line, bar, and pie charts I needed some real data. My job was to write a process to fetch our sales data from the AS400 server here at work nightly and populate some SQL Server tables with it. Easy Peasy, I thought. I didn't know what I was in for.
Comments are currently closed

Flex And IE Out Of Memory Error

ActionScript, Flash, Flex, Performance
So in the past 3 days I have been trying Flex I've had several out of memory errors that crashed my browser. I don't know if it is my operating system, my browser, Flash in general, or Flex, but it sucks. For the record I am using Windows XP Pro, IE 7, Flash 9, and Flex 3. This is what happens: As I develop, I keep hitting save in Flex Builder, waiting for it to recompile in the background, then Alt-tabbing over to IE and whacking F5 to refresh. Well, over the course of 2 or 3 hours of doing this, the memory usage for iexpolore.exe just keeps climbing and climbing as though there is a memory leak or garbage collection isn't happening.
Comments are currently closed

ColdFusion's Object Instantiation Penalty: How Bad Is It?

ColdFusion, Java, Object Oriented Design (OOP), Performance
There has been a lot of talk recently about design patterns aimed at circumventing the overhead ColdFusion imposes upon us when creating CFCs. I'm not sure who coined the term "Object Instantiation Penalty", but the first reference to it I can find in the CF community was over at the Dot Matrix blog. Everyone seems to agree that object creation in ColdFusion leaves something to be desired, but I haven't seen anyone really quantify the price yet. I decided some line charts were in order.
Comments are currently closed

Does OOP Encourage RBAR?

ColdFusion, Java, Object Oriented Design (OOP), Performance, SQL
I've been staring at my computer monitor trying start this paragraph for about 10 minutes now, so I'm just going to start typing. I've been thinking about system design. Organization versus performance. Design patterns versus efficiency. We adopt some code without thought to its performance because we're talking about milliseconds, and the readability, organization, and structure gains our apps enjoy are well worth it. I'm not sure that is always the case though, and we don't notice it until too late.
Comments are currently closed

I use a batch file to only start CF when I need it

ColdFusion, Performance
On my home PC I have the developer edition of ColdFusion 8 installed along with Apache Web Server and MySQL 5. Apache and MySQL are pretty lightweight, but ColdFusion can get a little bulky when it comes to memory. I don't use my personal Dev sites all the time, so I like to turn it all off when I'm not using it. I only have 1 gig of RAM in this PC after all.
Comments are currently closed