mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 13:52:28 +00:00
Rewrite IPv4 Turf War backend
It can now handle 240k SQLite write QPS at 3ms 99 percentile latency. We're still working out the kinks since it's brand new. But we've got this running in production already!
This commit is contained in:
parent
ccbae7799e
commit
91e167caaf
11 changed files with 1021 additions and 6 deletions
4
third_party/sqlite3/os_unix.c
vendored
4
third_party/sqlite3/os_unix.c
vendored
|
@ -5766,6 +5766,7 @@ static const char *unixTempFileDir(void){
|
|||
static int unixGetTempname(int nBuf, char *zBuf){
|
||||
const char *zDir;
|
||||
int iLimit = 0;
|
||||
int e = errno; // [jart] don't pollute strace logs
|
||||
|
||||
/* It's odd to simulate an io-error here, but really this is just
|
||||
** using the io-error infrastructure to test that SQLite handles this
|
||||
|
@ -5785,6 +5786,7 @@ static int unixGetTempname(int nBuf, char *zBuf){
|
|||
zDir, r, 0);
|
||||
if( zBuf[nBuf-2]!=0 || (iLimit++)>10 ) return SQLITE_ERROR;
|
||||
}while( osAccess(zBuf,0)==0 );
|
||||
errno = e; // [jart] don't pollute strace logs
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
|
@ -6317,8 +6319,10 @@ static int unixAccess(
|
|||
|
||||
if( flags==SQLITE_ACCESS_EXISTS ){
|
||||
struct stat buf;
|
||||
int e = errno; // [jart] don't clobber errno
|
||||
*pResOut = 0==osStat(zPath, &buf) &&
|
||||
(!S_ISREG(buf.st_mode) || buf.st_size>0);
|
||||
errno = e; // [jart] don't clobber errno
|
||||
}else{
|
||||
*pResOut = osAccess(zPath, W_OK|R_OK)==0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue