How Fast is SuperFastDistinct?
Really fast! It takes around 1ms to retrieve each distinct value on a 2.4 ghz computer with an average size table. So if the table had 50 distinct values, it would take around 50ms to retrieve the values. This is much faster than using an SQL statement like:
Select Distinct col1 [,col2,col3…] from Table1 order by col1 [,col2,col3…]
You can expect speed improvements of around 5x faster on medium size tables.Usually the larger the table, the better the performance increase compared to SQL. Surprisingly though SuperFastDistnct! will benchmark a lot of the smaller tables at 0 milliseconds and you can't get any fast than that (and that's without using any cache)! We also noticed that although the first SQL call to a BDE Paradox table is slow, subsequent SQL calls to the table is quite fast. This is because the BDE 'cheats' in that it will cache a lot of the table in memory so repetitive SQL calls using the BDE will produce some very fast benchmark results. But this comes at the expense of using a lot of memory to keep the table resident in memory on the client's machine. In this demo for example, BDE Paradox consumed a whopping 100 megabytes of memory to get the distinct values from a 1 million row table. SuperFastDistinct! on the otherhand, consumed only 1 kilobyte of memory, just enough memory to store the distinct values that were returned. Not only is SuperFastDistinct! several times faster than Paradox, but it used 100,000x less memory too. I guess now you know why we put the "!" in "SuperFastDistinct!".
If you want to see how bad SQL can be, create a one million row benchmark table (you will need approx 500MB disk space available) and measure the speed and memory consumed during the test. Now restart the program and compare that to SuperFastDistinct!. I think you'll be impressed by the speed and the memory you'll save.