Fossil

Timeline
Login

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

About 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.
2 check-ins related to "auto-webpage-txn"
2020-05-27
13:28
Demonstrate how the mkindex.c utility could be extended to automatically put a complete web-page construction inside a transaction. Closed-Leaf check-in: 67c420402f user: drh tags: auto-webpage-txn
2020-05-26
18:30
Fix a bug in the "Delete Ad-Unit" button in the setup pages. check-in: 48dca1b4c9 user: drh tags: trunk