/ Check-in [adf9fefb]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Performance improvement in sqlite3VarintLen().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: adf9fefb00ae1dbb07a921c6796cb0a9505c6d19
User & Date: drh 2015-09-01 22:29:07
Context
2015-09-01
23:51
Very minor optimizations in the unix VFS. check-in: 6db3ff45 user: drh tags: trunk
22:29
Performance improvement in sqlite3VarintLen(). check-in: adf9fefb user: drh tags: trunk
20:09
Small size reduction and performance increase in sqlite3DbMallocSize(). check-in: 8a80967f user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/util.c.

1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
}

/*
** Return the number of bytes that will be needed to store the given
** 64-bit integer.
*/
int sqlite3VarintLen(u64 v){
  int i = 0;
  do{
    i++;
    v >>= 7;
  }while( v!=0 && ALWAYS(i<9) );
  return i;
}


/*
** Read or write a four-byte big-endian integer value.
*/







|
|
<
<
<







1061
1062
1063
1064
1065
1066
1067
1068
1069



1070
1071
1072
1073
1074
1075
1076
}

/*
** Return the number of bytes that will be needed to store the given
** 64-bit integer.
*/
int sqlite3VarintLen(u64 v){
  int i;
  for(i=1; (v >>= 7)!=0; i++){ assert( i<9 ); }



  return i;
}


/*
** Read or write a four-byte big-endian integer value.
*/