Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doccursor: cache calls to certain internal methods
As I kept an eye on performance throughout this series, I thought caching could save a few calls to some reasonably complex functions. As I was doing it though, it became obvious it wouldn't improve much, but it has its advantages and it seems worth a few lines of code and all 5 minutes it took to implement. Right now, this only really saves any time on the type fixup method, which is called 2-3 times on any given cursor (not counting recursion). And that should not make much of a difference, naturally. On the upside: - Once we pass the cursors to docstring and start calling them in situ, we will likely be calling on these properties a lot more often. - Once cursors get passed to user land through extensions, caching can save an arbitrary amount of calls. - Should always be useful no matter how the cursor object evolves. - It's a simple concept to maintain. On the downside: - It doesn't really improve performance on our test suite in any meaningful way. - There are probably other clean-ups more relevant to performance, though not as easy to achieve as this one :)
- Loading branch information