Fossil SCM
branch/auto-webpage-txn
The initial check-in on this branch is a proof-of-concept to show how we might add new attributes to the "mkindex.c" scanner for webpages in order to put all page generation inside a single SQLite read-transaction. This helps SQLite to run faster. In the initial check-in, a large timeline used about 4% fewer CPU cycles in user space. The savings in kernel CPU cycles is likely also substantial.
Moving forward we might consider additional attributes like this:
-
read-only → Guarantee that the web-page (or command) will never modify the repository. Perhaps open the repository in read-only mode in this case.
-
txn → Maybe use a shorter name like this to indicate that a transaction surrounding all web page generation would be helpful.
-
read/write → The web-page might modify the repository.
-
same-origin → Disable query and POST parameters and/or make the database read-only if the query does not originate from the same origin. This would be a security enhancement, not a performance enhancement.
Other possible enhancements inspired by this experiment:
- Instrument the code to identify webpages and/or commands that use a large number of transactions. Most interactions should group all SQL statements inside one or two transactions. If we see some webpages needing hundreds or thousands of transactions, that is an indication of an optimization opportunity.