Not really. As any transaction can have a downstream effect on any other one due to inventory booking rules against accumulated inventory state and plug-in specific behaviors *in general* it is not possible to do partial caching. I'm sure we could think of ways to partition the sets of transactions into disjoint subsets and make reasonable assumptions on the locality of the behaviors of plugins, but that's a separate idea and fwiw I've never tried - because the obvious solution is a faster implementation, which should be fast enough.
The duckdb prototype is basically a POC that we could possibly replace Beanquery by extending a DB engine that already exists. I feel like Beanquery is about two things: support custom table for reporting (e.g. open, close) and support inventory aggregation. The former can be implemented with a special table specification statement and the latter with struct types and a custom aggregator. The feasibility of the latter is what this demo shows is possible. The extensible SQL engine is hard to build and maintain, and I'm showing here that with just a few tricks we can leverage a really great one (duckdb).
About a faster parser: I've been playing with some new ideas with AI models and I have a fun new idea to translate beancount's core and tests into a spec and test cases that could be used to prompt a properly validated generation of the same core concepts to any language. I think this would be possible, or soon will be with the latest frontier models. So beancount could just become a carefully created set of markdown documents and validation test suite complete enough to be unambiguous, with various implementations (roll your own at will). If this works, this could portend an interesting idea for the future of development and specification of software - a description sufficient enough for the code itself to become entirely unnecessary. Think: literal programming without the programming bits.
Also, I've toyed around with AI directed translation of some core parts of the python implementation to C (parser + inventory). Definitely doable, and a more pragmatic way to speed up the current implementation incrementally. These are oddball ideas though, needs more work.