[Mono-dev] Patch for Mono.SqliteClient.SqliteDataReader REVIEW NEEDED

Scott Peterson lunchtimemama at gmail.com
Sat Dec 29 04:45:41 EST 2007


I'm about to look at fixing this:
http://codicesoftware.blogspot.com/2007/11/c-mono-performance.html. I'm
acquainting myself with the relevant files and this is an optimization I
noticed off the bat. If someone could just make sure this is A-O.K., I'll go
ahead and commit it. Next, if anyone who's familiar with the database
binding code could brief me on all of the places IDataRecord and IDataReader
are implemented, that would be great.


Index:
class/Mono.Data.SqliteClient/Mono.Data.SqliteClient/SqliteDataReader.cs
===================================================================
---
class/Mono.Data.SqliteClient/Mono.Data.SqliteClient/SqliteDataReader.cs
(revision 92007)
+++
class/Mono.Data.SqliteClient/Mono.Data.SqliteClient/SqliteDataReader.cs
(working copy)
@@ -65,14 +65,7 @@
         internal SqliteDataReader (SqliteCommand cmd, IntPtr pVm, int
version)
         {
             command = cmd;
-            rows = new ArrayList ();
-            column_names_sens = new Hashtable ();
-#if NET_2_0
-            column_names_insens = new Hashtable (
StringComparer.InvariantCulture);
-#else
-            column_names_insens = new Hashtable (
CaseInsensitiveHashCodeProvider.DefaultInvariant,
-                                 CaseInsensitiveComparer.DefaultInvariant);
-#endif
+
             closed = false;
             current_row = -1;
             reading = true;
@@ -147,6 +140,16 @@
                 // For the first row, get the column information
                 if (first) {
                     first = false;
+
+                    rows = new ArrayList (pN);
+                    column_names_sens = new Hashtable (pN);
+#if NET_2_0
+                    column_names_insens = new Hashtable (pN,
StringComparer.InvariantCulture);
+#else
+                    column_names_insens = new Hashtable (pN,
+
CaseInsensitiveHashCodeProvider.DefaultInvariant,
+
CaseInsensitiveComparer.DefaultInvariant);
+#endif

                     if (version == 3) {
                         // A decltype might be null if the type is unknown
to sqlite.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20071229/eb7555b9/attachment.html 


More information about the Mono-devel-list mailing list