c# - Performing ForEach -


i need increase performance of foreach.

//pseudocode foreach (item item in items) { //call service open db conn , data } 

within loop make call service opens session sqlserver, gets data database , closes session, each iteration. can do?. thanks.

well sound use of parallel.foreach - have tried it?

parallel.foreach(queries, query => {     // perform query }); 

you may want specify options around level of parallelism etc - , make sure connection pool supports many connections want. , of course, measure performance before , after make sure it's helping.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -