Fossil

Check-in [52211ccc]
Login

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

Overview
Comment:Add the --limit N option to the test-parse-all-blobs test command, so that we can easily limit the run-time of that command for cachegrind performance testing.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 52211ccc2f90d333213cfd790458dcc16c5e471822d01d396a6dd9f735809885
User & Date: drh 2019-09-12 16:43:29
Context
2019-09-12
16:51
Use strspn() to improve the performance of validate16(). check-in: c550d6e0 user: drh tags: trunk
16:43
Add the --limit N option to the test-parse-all-blobs test command, so that we can easily limit the run-time of that command for cachegrind performance testing. check-in: 52211ccc user: drh tags: trunk
16:31
Performance optimization in the control artifact parser. check-in: 3d802ec5 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/manifest.c.

1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156


1157
1158
1159
1160
1161
1162
1163


1164


1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
    manifest_destroy(p);
  }
}

/*
** COMMAND: test-parse-all-blobs
**
** Usage: %fossil test-parse-all-blobs
**
** Parse all entries in the BLOB table that are believed to be non-data
** artifacts and report any errors.  Run this test command on historical
** repositories after making any changes to the manifest_parse()
** implementation to confirm that the changes did not break anything.


*/
void manifest_test_parse_all_blobs_cmd(void){
  Manifest *p;
  Blob err;
  Stmt q;
  int nTest = 0;
  int nErr = 0;


  db_find_and_open_repository(0, 0);


  verify_all_options();
  db_prepare(&q, "SELECT DISTINCT objid FROM EVENT");
  while( db_step(&q)==SQLITE_ROW ){
    int id = db_column_int(&q,0);
    fossil_print("Checking %d       \r", id);
    nTest++;
    fflush(stdout);
    blob_init(&err, 0, 0);
    p = manifest_get(id, CFTYPE_ANY, &err);
    if( p==0 ){







|





>
>







>
>

>
>


|







1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
    manifest_destroy(p);
  }
}

/*
** COMMAND: test-parse-all-blobs
**
** Usage: %fossil test-parse-all-blobs [--limit N]
**
** Parse all entries in the BLOB table that are believed to be non-data
** artifacts and report any errors.  Run this test command on historical
** repositories after making any changes to the manifest_parse()
** implementation to confirm that the changes did not break anything.
**
** If the --limit N argument is given, parse no more than N blobs
*/
void manifest_test_parse_all_blobs_cmd(void){
  Manifest *p;
  Blob err;
  Stmt q;
  int nTest = 0;
  int nErr = 0;
  int N = 1000000000;
  const char *z;
  db_find_and_open_repository(0, 0);
  z = find_option("limit", 0, 1);
  if( z ) N = atoi(z);
  verify_all_options();
  db_prepare(&q, "SELECT DISTINCT objid FROM EVENT");
  while( (N--)>0 && db_step(&q)==SQLITE_ROW ){
    int id = db_column_int(&q,0);
    fossil_print("Checking %d       \r", id);
    nTest++;
    fflush(stdout);
    blob_init(&err, 0, 0);
    p = manifest_get(id, CFTYPE_ANY, &err);
    if( p==0 ){