Browse Source

Merge branch 'performance_singlerow' of https://github.com/MalcolmEvershed/FrameworkBenchmarks into MalcolmEvershed-performance_singlerow

Patrick Falls 12 years ago
parent
commit
0ad6629f0a
1 changed files with 6 additions and 2 deletions
  1. 6 2
      aspnet/src/Controllers/AdoController.cs

+ 6 - 2
aspnet/src/Controllers/AdoController.cs

@@ -45,7 +45,9 @@ namespace Benchmarks.AspNet.Controllers
                         command.Parameters.Clear();
                         command.Parameters.Add(parameter);
                         
-                        using (DbDataReader reader = command.ExecuteReader(CommandBehavior.SingleRow))
+                        // Don't use CommandBehavior.SingleRow because that will make the MySql provider
+                        // send two extra commands to limit the result to one row.
+                        using (DbDataReader reader = command.ExecuteReader())
                         {
                             if (reader.Read())
                             {
@@ -124,7 +126,9 @@ namespace Benchmarks.AspNet.Controllers
 
                         World world = null;
 
-                        using (DbDataReader reader = selectCommand.ExecuteReader(CommandBehavior.SingleRow))
+                        // Don't use CommandBehavior.SingleRow because that will make the MySql provider
+                        // send two extra commands to limit the result to one row.
+                        using (DbDataReader reader = selectCommand.ExecuteReader())
                         {
                             if (reader.Read())
                             {