Blog

Category Filtering: 'Performance'

Remove Filter


ColdFusion UDF: Calculate A Number's Divisors

Posted by Brad Wood
Aug 15, 2009 06:24:00 UTC
Here's another UDF I was tinkering with last week. I wanted to be able to count all of the numbers that divided evenly into a given integer. I couldn't find a ColdFusion implementation, so after getting some advice from Stack Overflow I created my own.

Calculate Prime Numbers: Sieve of Eratosthenes

Posted by Brad Wood
Aug 14, 2009 06:34:00 UTC
Ahh... the quintessential math problem-- finding prime numbers. Last week while tinkering with a math challenge I needed to find all of the primes up to a given number. There was a version on cflib.org, but I thought I could do it in less code, so I dug in myself.

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

Posted by Brad Wood
May 13, 2009 07:31:00 UTC
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.

SQL Temp Tables

Posted by Brad Wood
May 03, 2009 07:05:00 UTC
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:

SQL Server Performance: How Are My Indexes Being Using?

Posted by Brad Wood
Feb 14, 2009 20:42:00 UTC
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.

SQL Server Gotcha: Implicit Unicode Conversion

Posted by Brad Wood
Feb 14, 2009 06:54:00 UTC
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

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

Posted by Brad Wood
Nov 21, 2008 12:27:00 UTC
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.

MSSQL's openquery Saved Me

Posted by Brad Wood
Oct 04, 2008 11:34:00 UTC
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.

Flex And IE Out Of Memory Error

Posted by Brad Wood
Sep 26, 2008 11:56:00 UTC
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.

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

Posted by Brad Wood
Sep 22, 2008 13:58:00 UTC
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.

Site Updates

Entries Search