System.Data.SQLite
Check-in [d0e28511f3]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:For the debug build configuration only, keep track of how many times each runtime configuration setting is read and have the test suite report on same. Pursuant to [58ed318f2f].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d0e28511f30527cf1dd6c664208a677239f66c60
User & Date: mistachkin 2014-07-29 22:48:24
References
2014-07-29
22:53 Ticket [58ed318f2f] GetValue hits the xml config file every time status still Open with 3 other changes artifact: b297f95088 user: mistachkin
Context
2014-07-30
00:39
Minimize usage of the 'Use_SQLiteConvert_DefaultDbType' and 'Use_SQLiteConvert_DefaultTypeName' settings. Fix for [58ed318f2f]. check-in: 69065c8e3b user: mistachkin tags: trunk
2014-07-29
22:48
For the debug build configuration only, keep track of how many times each runtime configuration setting is read and have the test suite report on same. Pursuant to [58ed318f2f]. check-in: d0e28511f3 user: mistachkin tags: trunk
22:42
Update the Entity Framework version. check-in: a5705bb3db user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to System.Data.SQLite/UnsafeNativeMethods.cs.

    88     88         #region Private Data
    89     89         /// <summary>
    90     90         /// This lock is used to protect the static _SQLiteNativeModuleFileName,
    91     91         /// _SQLiteNativeModuleHandle, and processorArchitecturePlatforms fields.
    92     92         /// </summary>
    93     93         private static readonly object staticSyncRoot = new object();
    94     94   
           95  +
           96  +      /////////////////////////////////////////////////////////////////////////
           97  +      /// <summary>
           98  +      /// This dictionary stores the read counts for the runtime configuration
           99  +      /// settings.  This information is only recorded when compiled in the
          100  +      /// "Debug" build configuration.
          101  +      /// </summary>
          102  +#if DEBUG
          103  +      private static Dictionary<string, int> settingReadCounts;
          104  +#endif
          105  +
    95    106         /////////////////////////////////////////////////////////////////////////
    96    107         /// <summary>
    97    108         /// This dictionary stores the mappings between processor architecture
    98    109         /// names and platform names.  These mappings are now used for two
    99    110         /// purposes.  First, they are used to determine if the assembly code
   100    111         /// base should be used instead of the location, based upon whether one
   101    112         /// or more of the named sub-directories exist within the assembly code
................................................................................
   130    141             if (GetSettingValue("No_PreLoadSQLite", null) != null)
   131    142                 return;
   132    143   #endif
   133    144   #endif
   134    145   
   135    146             lock (staticSyncRoot)
   136    147             {
          148  +#if DEBUG
          149  +              //
          150  +              // NOTE: Create the list of statistics that will contain the
          151  +              //       number of times each setting value has been read.
          152  +              //
          153  +              if (settingReadCounts == null)
          154  +                  settingReadCounts = new Dictionary<string, int>();
          155  +#endif
          156  +
   137    157                 //
   138    158                 // TODO: Make sure this list is updated if the supported
   139    159                 //       processor architecture names and/or platform names
   140    160                 //       changes.
   141    161                 //
   142    162                 if (processorArchitecturePlatforms == null)
   143    163                 {
................................................................................
   246    266         internal static string GetSettingValue(
   247    267             string name,    /* in */
   248    268             string @default /* in */
   249    269             )
   250    270         {
   251    271             if (name == null)
   252    272                 return @default;
          273  +
          274  +          /////////////////////////////////////////////////////////////////////
          275  +
          276  +          #region Debug Build Only
          277  +#if DEBUG
          278  +          //
          279  +          // NOTE: Update statistics for this setting value.
          280  +          //
          281  +          if (settingReadCounts != null)
          282  +          {
          283  +              int count;
          284  +
          285  +              if (settingReadCounts.TryGetValue(name, out count))
          286  +                  settingReadCounts[name] = count + 1;
          287  +              else
          288  +                  settingReadCounts.Add(name, 1);
          289  +          }
          290  +#endif
          291  +          #endregion
          292  +
          293  +          /////////////////////////////////////////////////////////////////////
   253    294   
   254    295             string value = null;
   255    296   
   256    297   #if !PLATFORM_COMPACTFRAMEWORK
   257    298             bool expand = true;
   258    299   
   259    300             if (Environment.GetEnvironmentVariable("No_Expand") != null)

Changes to Tests/common.eagle.

  2196   2196               tputs $channel [appendArgs \
  2197   2197                   "---- call sqlite3_shutdown()... error: " \n\t $result \n]
  2198   2198             }
  2199   2199           }
  2200   2200         }
  2201   2201       }
  2202   2202   
  2203         -    proc reportSQLiteResources { channel {quiet false} {collect true} } {
         2203  +    proc reportSQLiteResources {
         2204  +            channel {quiet false} {reset true} {collect true} } {
  2204   2205         #
  2205         -      # NOTE: Skip all output if we are running in "quiet" mode.
         2206  +      # NOTE: If available, report on (and possibly reset) the runtime
         2207  +      #       configuration statistics.
  2206   2208         #
         2209  +      if {[haveConstraint buildConfiguration.Debug] && [catch {
         2210  +        object invoke -flags +NonPublic -alias \
         2211  +            System.Data.SQLite.UnsafeNativeMethods settingReadCounts
         2212  +      } settingReadCounts] == 0} then {
         2213  +        set nameCount [$settingReadCounts Count]
         2214  +        set valueCount 0
         2215  +
         2216  +        object foreach -alias pair $settingReadCounts {
         2217  +          incr valueCount [$pair Value]
         2218  +
         2219  +          if {!$quiet} then {
         2220  +            tputs $channel [appendArgs \
         2221  +                "---- setting \"" [$pair Key] "\" was read " \
         2222  +                [$pair Value] " times\n"]
         2223  +          }
         2224  +        }
         2225  +
         2226  +        if {$reset} then {
         2227  +          if {[catch {$settingReadCounts Clear} error] == 0} then {
         2228  +            if {!$quiet} then {
         2229  +              tputs $channel [appendArgs \
         2230  +                  "---- reset setting statistics for the previous " \
         2231  +                  $nameCount " names and " $valueCount " values read\n"]
         2232  +            }
         2233  +          } else {
         2234  +            tputs $channel [appendArgs \
         2235  +                "==== WARNING: failed to reset setting statistics for " \
         2236  +                "the previous " $nameCount " names and " $valueCount \
         2237  +                " values read, error: " \n\t $error \n]
         2238  +          }
         2239  +        }
         2240  +      }
         2241  +
  2207   2242         if {[haveConstraint \
  2208   2243                 defineConstant.System.Data.SQLite.INTEROP_VIRTUAL_TABLE] && \
  2209   2244             [haveConstraint \
  2210   2245                 defineConstant.System.Data.SQLite.TRACK_MEMORY_BYTES]} then {
  2211   2246           if {!$quiet} then {
  2212   2247             tputs $channel "---- current memory in use by SQLiteMemory... "
  2213   2248           }