I have a CF application I'm porting from VS2003/SQL CE 2.0 to VS2005/SQL Mobile. I make extensive use of RDA and unfortunately there is a huge performance degredation for me going to SQL Mobile. Where most PULL's in 2.0 take no more than a second or 2 to complete, they are taking around 10 or 11 seconds in SQL Mobile. This is the time from when .PULL starts and ends, it does not include any code run before or after the .PULL is issued, so it definitely something during the PULL that is slower.
I have tried settins of 0,1,3, and 6 for the compression level, all gave similar results, around 10 or 11 seconds. I have also tried doing a .SubmitSQL right before the .PULL to see if a sort of cached connection would help, but it only shaved a second off the time in most cases.
These times are using the same IIS server, SQL server (2000 SP3a), and database. I have tried using a 2003 SE device, WM 5.0 device, WM 5.0 emulator, and 2003 SE emulator, all exhibit the same performance degradation.
I really need to figure this out or I can't move the product to 2005 as the synchronization times would be completely unacceptable to our customers. Has anyone else run into this problem or know of a solution to it?
Thanks!
-Manny
Well, I managed to get the time down. After looking at both versions doing Pull's via SQL Trace, I discovered that the time to begin and to execute the things that happen on SQL server was pretty much the same for both, but the difference came after SQL Mobile was done using SQL Server...there was about an 8 or second lag between finishing the database access and the Pull command completing.
I discovered through the SQL Mobile Books Online that SQL Mobile now has logging that can be enabled through the registry. I tried that and then looked at the resulting log and discovered this happening after it was done accessing SQL Server:
2007/01/05 11:36:09 Thread=13BC RSCB=173 Command=CLOS Hr=00000000 Total Uncompressed bytes out = 249
2007/01/05 11:36:12 Thread=13BC RSCB=173 Command=CLOS Hr=80070005 ERR:DeleteFile failed 0
2007/01/05 11:36:15 Thread=13BC RSCB=173 Command=CLOS Hr=80070005 ERR:DeleteFile failed 0
If you look at the times, you'll see that the 2 errors account for about 6 seconds.
I managed to eliminate those errors by setting full control to the Internet Guest user for the windows directory that sqlce30.dll is in. After that fix, my Pulls are now taking around 4 or 5 seconds rather than 10 or 11, about 6 seconds faster!
I'm still not quite at the speed of 2.0, though. I synchronize 70 tables and in 2.0, this is taking around 3 minutes. In 3.0 it's now taking around 4.5 minutes. Still much better than the 13 or so minutes it was taking!
Any ideas how I can squeeze the last 2 seconds out so it's equivalent to the 2.0 version?