Small. Fast. Reliable.
Choose any three.
*** 2,7 ****
--- 2,13 ----
  
  ----
  
+ *Reduce overhead of bulk inserts*
+ 
+ As a test, I modified fts2.c to collect multiple inserts with increasing rowids into in-memory structures, then flush them out as a single level-0 segment.  When it flushes every 100 documents, performance is increased by up to 40%.  This is even better than the gains from doing bulk inserts in the first place.
+ 
+ ----
+ 
  *Prefix-encode first terms*
  
  At this time, interior and leaf nodes fully-encode their first terms, and prefix-encode later terms.  If we passed the key which decided which child to take down from the interior node, we could prefix-encode the first term against that.  Thus, if we have runs of very long terms, we could save the initial hit from fully-encoding the term.