The new branch, [speedy-cli](https://sqlite.org/src/timeline?r=speedy_cli&c=2021-09-10+00%3A58%3A46), deals with the problems and challenges mentioned in this thread. It runs faster than the current shell for all cases readily at hand, including the gulping of millions of semicolon-terminated SQL lines within a block-comment.<sup>a</sup> As far as I can see, the O n^2 runtime behavior is gone. Whether this branch will be merged to trunk remains to be seen. It's a lot of new and critical code in a tool used extensively for internal testing and widely used externally. So the perceived risk/benefit ratio may doom it. Any problem reports against the branch will be very welcome. ---- a. For such input with 50 character statements, about 2e6 lines/second on my non-sloucher, Core i7