Fossil SCM
Speedup of "fossil rebuild" by not calculating the Z checksum unnecessary. Doing a "fossil rebuild" on the Tcl fossil repository, this saves about 1 second (out of 1m22) on my machine. OK, OK, not THAT impressive, but it's a measurable gain with 0 cost.
Commit
960fb04e35a529e32cb7cc1dfe591754e50b8596
Parent
3c5f1f08d81fe8b…
1 file changed
+8
-7
+8
-7
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -378,27 +378,28 @@ | ||
| 378 | 378 | blob_reset(pContent); |
| 379 | 379 | blob_appendf(pErr, n ? "not terminated with \\n" : "zero-length"); |
| 380 | 380 | return 0; |
| 381 | 381 | } |
| 382 | 382 | |
| 383 | - /* Strip off the PGP signature if there is one. Then verify the | |
| 384 | - ** Z-card. | |
| 383 | + /* Strip off the PGP signature if there is one. | |
| 385 | 384 | */ |
| 386 | 385 | remove_pgp_signature(&z, &n); |
| 387 | - if( verify_z_card(z, n)==2 ){ | |
| 388 | - blob_reset(pContent); | |
| 389 | - blob_appendf(pErr, "incorrect Z-card cksum"); | |
| 390 | - return 0; | |
| 391 | - } | |
| 392 | 386 | |
| 393 | 387 | /* Verify that the first few characters of the artifact look like |
| 394 | 388 | ** a control artifact. |
| 395 | 389 | */ |
| 396 | 390 | if( n<10 || z[0]<'A' || z[0]>'Z' || z[1]!=' ' ){ |
| 397 | 391 | blob_reset(pContent); |
| 398 | 392 | blob_appendf(pErr, "line 1 not recognized"); |
| 399 | 393 | return 0; |
| 394 | + } | |
| 395 | + /* Then verify the Z-card. | |
| 396 | + */ | |
| 397 | + if( verify_z_card(z, n)==2 ){ | |
| 398 | + blob_reset(pContent); | |
| 399 | + blob_appendf(pErr, "incorrect Z-card cksum"); | |
| 400 | + return 0; | |
| 400 | 401 | } |
| 401 | 402 | |
| 402 | 403 | /* Allocate a Manifest object to hold the parsed control artifact. |
| 403 | 404 | */ |
| 404 | 405 | p = fossil_malloc( sizeof(*p) ); |
| 405 | 406 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -378,27 +378,28 @@ | |
| 378 | blob_reset(pContent); |
| 379 | blob_appendf(pErr, n ? "not terminated with \\n" : "zero-length"); |
| 380 | return 0; |
| 381 | } |
| 382 | |
| 383 | /* Strip off the PGP signature if there is one. Then verify the |
| 384 | ** Z-card. |
| 385 | */ |
| 386 | remove_pgp_signature(&z, &n); |
| 387 | if( verify_z_card(z, n)==2 ){ |
| 388 | blob_reset(pContent); |
| 389 | blob_appendf(pErr, "incorrect Z-card cksum"); |
| 390 | return 0; |
| 391 | } |
| 392 | |
| 393 | /* Verify that the first few characters of the artifact look like |
| 394 | ** a control artifact. |
| 395 | */ |
| 396 | if( n<10 || z[0]<'A' || z[0]>'Z' || z[1]!=' ' ){ |
| 397 | blob_reset(pContent); |
| 398 | blob_appendf(pErr, "line 1 not recognized"); |
| 399 | return 0; |
| 400 | } |
| 401 | |
| 402 | /* Allocate a Manifest object to hold the parsed control artifact. |
| 403 | */ |
| 404 | p = fossil_malloc( sizeof(*p) ); |
| 405 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -378,27 +378,28 @@ | |
| 378 | blob_reset(pContent); |
| 379 | blob_appendf(pErr, n ? "not terminated with \\n" : "zero-length"); |
| 380 | return 0; |
| 381 | } |
| 382 | |
| 383 | /* Strip off the PGP signature if there is one. |
| 384 | */ |
| 385 | remove_pgp_signature(&z, &n); |
| 386 | |
| 387 | /* Verify that the first few characters of the artifact look like |
| 388 | ** a control artifact. |
| 389 | */ |
| 390 | if( n<10 || z[0]<'A' || z[0]>'Z' || z[1]!=' ' ){ |
| 391 | blob_reset(pContent); |
| 392 | blob_appendf(pErr, "line 1 not recognized"); |
| 393 | return 0; |
| 394 | } |
| 395 | /* Then verify the Z-card. |
| 396 | */ |
| 397 | if( verify_z_card(z, n)==2 ){ |
| 398 | blob_reset(pContent); |
| 399 | blob_appendf(pErr, "incorrect Z-card cksum"); |
| 400 | return 0; |
| 401 | } |
| 402 | |
| 403 | /* Allocate a Manifest object to hold the parsed control artifact. |
| 404 | */ |
| 405 | p = fossil_malloc( sizeof(*p) ); |
| 406 |