Why provides that shapefile provider faster than sqlserver2008 provider

Topics: SharpMap Project, WinForms Controls
Nov 16, 2012 at 1:22 PM

I'm working on faster  sqlserver provider. I realised file based shapefile data provider rendering faster than sql2008. However I'm trying to use parallel.for loops on some rendering methods, I couldn't achieve rendering as fast as shapefile rendering.

Moreover, I tried to use multi tasking by changing;

 ThreadPool.QueueUserWorkItem(   delegate{

GetImagesAsync(bbox);    

GetImagesAsyncEnd(new GetImageEndResult { Tool = oldTool, bbox = bbox, generation = generation });                

 });

into


 var compute = Task.Factory.StartNew(() =>                           

{GetImagesAsync(bbox, token); 

GetImagesAsyncEnd(new GetImageEndResult

{ Tool = oldTool, bbox = bbox, generation = generation }, token);                                                            }, token);

 

Can you give some clues for better performance?

Coordinator
Nov 17, 2012 at 9:50 PM

First you need to understand where your performance problems are, what part of the rendering from SQL-server takes the longest time?

Is it fetching data from the database, or the actual rendering?

Do you have spatial indexes on your database?

 

Task.Factory.StartNew(()  does not perform any better than the ThreadPool since Task also rely on Threads to perform the actual work.