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
Post a Comment