Overview
SHA1 Hash: | 8010bb41e1c777a5a0d57e03edc7f7baea5dab8f |
---|---|
Date: | 2008-03-08 18:59:00 |
User: | drh |
Comment: | Speed enhancement in the findSrcid() routine of content.c. Allow 5 digit numbers on counts while syncing. |
Timelines: | ancestors | descendants | both | trunk |
Other Links: | files | ZIP archive | manifest |
Tags And Properties
- branch=trunk inherited from [a28c83647d]
- sym-trunk inherited from [a28c83647d]
Changes
[hide diffs]Modified src/content.c from [6b8e09987a] to [7cc68e90ad].
@@ -81,11 +81,20 @@ /* ** Return the srcid associated with rid. Or return 0 if rid is ** original content and not a delta. */ static int findSrcid(int rid){ - int srcid = db_int(0, "SELECT srcid FROM delta WHERE rid=%d", rid); + static Stmt q; + int srcid; + db_static_prepare(&q, "SELECT srcid FROM delta WHERE rid=:rid"); + db_bind_int(&q, ":rid", rid); + if( db_step(&q)==SQLITE_ROW ){ + srcid = db_column_int(&q, 0); + }else{ + srcid = 0; + } + db_reset(&q); return srcid; } /* ** Check to see if content is available for artifact "rid". Return
Modified src/xfer.c from [e66b8e6193] to [ac96ad6edd].
@@ -770,11 +770,11 @@ nMsg += send_unclustered(&xfer); } /* Exchange messages with the server */ nFileSend = xfer.nFileSent + xfer.nDeltaSent; - printf("Sent: %10d bytes, %4d messages, %4d files (%d+%d)\n", + printf("Sent: %10d bytes, %5d messages, %5d files (%d+%d)\n", blob_size(&send), nMsg+xfer.nGimmeSent+xfer.nIGotSent, nFileSend, xfer.nFileSent, xfer.nDeltaSent); nMsg = 0; xfer.nFileSent = 0; xfer.nDeltaSent = 0; @@ -921,11 +921,11 @@ fossil_fatal("%b", &xfer.err); } blobarray_reset(xfer.aToken, xfer.nToken); blob_reset(&xfer.line); } - printf("\rReceived: %10d bytes, %4d messages, %4d files (%d+%d+%d)\n", + printf("\rReceived: %10d bytes, %5d messages, %5d files (%d+%d+%d)\n", blob_size(&recv), nMsg, xfer.nFileRcvd + xfer.nDeltaRcvd + xfer.nDanglingFile, xfer.nFileRcvd, xfer.nDeltaRcvd, xfer.nDanglingFile); blob_reset(&recv);