kogmbh/WebODF — pull request #180 by peitschie (2013-11-13 07:58:17+00:00)
Title: Improve performance by adding a step to DOM point conversion cache

This is really huge, so I'm open to any ideas as to how to get this patch set reviewed and merged. This has undergone some internal QA, and will continue to do so for the remainder of this week.

The intent of this patch is to add a cache for conversion from a set step system (in this case, cursor positions) to DOM points (i.e., node + offset pairs) and back. Usage of this cache is vastly quicker to the previous implementation of walking from root every time a particular cursor step needed to be found.

The current cache uses a fairly rudimentary system for detecting cache points. The performance of this might potentially be improved in future by changing the datastructure (e.g., balanced binary trees), but for now the performance is adequate.

This patch can be broken down into a few relatively distinct sets:
ba18df5 - d11813c - Benchmark utility to track performance improvements (already pending review in pull request #178)
f1feaec - 5136126 - Cleanup and extracting some interfaces to start optimization
41c7cc1 - 8b0044a - Usability improvements to the extracted step translation interface. This eliminates some common bugs and errors made by consumers of the existing code
1e93a15 - 1e1f8f3 - Implement a caching version of the step translation interface.
4151123 - 3a07bc4 - Start swapping over code paths to use the new step translation interface