SQLite

Check-in [fc8d45086d]
Login

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

Overview
Comment:Optimization to sqlite3VtabUnlockList() for the common case when there is no work to do.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: fc8d45086dc2bcb9bce756088e99e63cbeedf9129139fb0e6a48b43c4f502180
User & Date: drh 2019-10-05 19:24:52.240
Context
2019-10-05
19:53
Omit the check for conflicting shared-cache locks in sqlite3Prepare() if the database connection uses no shared cache. We might be able to go back and remove this code completely, due to the newer Schema.iGeneration logic, but that will take more analysis. This check-in gives the speed benefit but not the reduction in code size. (check-in: 0b73a09270 user: drh tags: trunk)
19:24
Optimization to sqlite3VtabUnlockList() for the common case when there is no work to do. (check-in: fc8d45086d user: drh tags: trunk)
18:33
Call sqlite3Prepare() directly, rather than going through sqlite3_prepare(), when processing the sqlite_master.sql column for a schema. (check-in: cc49380ea7 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/vtab.c.
301
302
303
304
305
306
307
308
309
310
311
312
313

314
315
316
317
318
319
320
**      the database handle mutex is held.
**
** As a result, a sqlite3.pDisconnect cannot be accessed simultaneously 
** by multiple threads. It is thread-safe.
*/
void sqlite3VtabUnlockList(sqlite3 *db){
  VTable *p = db->pDisconnect;
  db->pDisconnect = 0;

  assert( sqlite3BtreeHoldsAllMutexes(db) );
  assert( sqlite3_mutex_held(db->mutex) );

  if( p ){

    sqlite3ExpirePreparedStatements(db, 0);
    do {
      VTable *pNext = p->pNext;
      sqlite3VtabUnlock(p);
      p = pNext;
    }while( p );
  }







<





>







301
302
303
304
305
306
307

308
309
310
311
312
313
314
315
316
317
318
319
320
**      the database handle mutex is held.
**
** As a result, a sqlite3.pDisconnect cannot be accessed simultaneously 
** by multiple threads. It is thread-safe.
*/
void sqlite3VtabUnlockList(sqlite3 *db){
  VTable *p = db->pDisconnect;


  assert( sqlite3BtreeHoldsAllMutexes(db) );
  assert( sqlite3_mutex_held(db->mutex) );

  if( p ){
    db->pDisconnect = 0;
    sqlite3ExpirePreparedStatements(db, 0);
    do {
      VTable *pNext = p->pNext;
      sqlite3VtabUnlock(p);
      p = pNext;
    }while( p );
  }