30. April 2005 05:00
For round two of my performance testing I made an application that makes better use of CPU cycles and transactions and gives SQL Mobile a chance
to show its true performance colors. The test platform was the same as before: CE.NET 4.2 device with 400mhz xScale and 128m RAM. The data used was also the same
as Test 1: 5,000 inserts, then 10,000 inserts into a different table, then 1000 Updates and 100 selects against the tables.
If you don't care to read all the details, here's the executive summary of what you can expect from SQL Mobile:
- Inserts for moderately sized tables are 10-12 times faster on SQL Mobile
- Updates are as much as 100% faster on average
- Table-scan Selects take less than half the time on SQL Mobile
I made a guess last time that an increased cost of getting connections and starting transactions (SQL Mobile has full ACID transactions whereas SqlCE is easily corruptible) might make SQL Mobile appear slower
for "one off" operations. This time I simply changed the test to re-use an open connection and SqlCeCommand.Prepare(). I am truly pleased by the improvement in Insert performance in particular. For Inserts and Updates in Mobile applications where
large amounts of data are being manipulated, grouping records into transactions would improve times even more. To Microsoft:
After years of complaining about SqlCE, the only suitable adjective I can find for SQL Mobile is impressive.
An exhaustive SQL Mobile vs. SqlCE 2 test would be nice but also take more time than I have right now.
I have not done any stored procedure performance tests, Transaction tests, nor any tests of table joins, nor any selects against Indexes, but this should be a rough
indication of performance.
In my next article, I will do some general performance testing on the Compact Framework V2 and one more SQL Mobile test. I intend to come up with a benchmark for:
- Windows forms drawing performance
- File IO
- XML Web service performance
- SqlCeResultSet performance
As always, I welcome any comments or questions.