1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Even if compile time option SQLITE_MAX_WORKER_THREADS is set to one or greater, set the default number of worker threads to zero. Distribute data more evenly between threads in sqlite3VdbeSorterWrite() to improve performance when sorting large amounts of data. Add new test file sort2.test.

FossilOrigin-Name: 643c86a056168e39fcb7f39b8a72731f1eb246db
This commit is contained in:
dan
2014-04-01 15:38:44 +00:00
parent 38fdead890
commit 578e1ca8d7
8 changed files with 102 additions and 17 deletions

View File

@@ -1253,6 +1253,32 @@ static int test_config_cis(
return TCL_OK;
}
/*
** Usage: sqlite3_config_worker_threads N
*/
static int test_config_worker_threads(
void * clientData,
Tcl_Interp *interp,
int objc,
Tcl_Obj *CONST objv[]
){
int rc;
int nThread;
if( objc!=2 ){
Tcl_WrongNumArgs(interp, 1, objv, "N");
return TCL_ERROR;
}
if( Tcl_GetIntFromObj(interp, objv[1], &nThread) ){
return TCL_ERROR;
}
rc = sqlite3_config(SQLITE_CONFIG_WORKER_THREADS, nThread);
Tcl_SetResult(interp, (char *)sqlite3ErrName(rc), TCL_VOLATILE);
return TCL_OK;
}
/*
** Usage: sqlite3_dump_memsys3 FILENAME
** sqlite3_dump_memsys5 FILENAME
@@ -1506,6 +1532,7 @@ int Sqlitetest_malloc_Init(Tcl_Interp *interp){
{ "sqlite3_config_error", test_config_error ,0 },
{ "sqlite3_config_uri", test_config_uri ,0 },
{ "sqlite3_config_cis", test_config_cis ,0 },
{ "sqlite3_config_worker_threads", test_config_worker_threads ,0 },
{ "sqlite3_db_config_lookaside",test_db_config_lookaside ,0 },
{ "sqlite3_dump_memsys3", test_dump_memsys3 ,3 },
{ "sqlite3_dump_memsys5", test_dump_memsys3 ,5 },