Optimised the code for drawing Long Keyframes by making the code use a Red-Black Tree instead of performing linear search over all the (potentially unsorted) BezTriples to find the previous one with a matching value.
As a result, the Redraw Timer (Ctrl Alt T) tool reports that the time needed to draw the keyframes region on a heavy imported-BVH file has dropped from an average of 270ms per draw, to about 60ms. The view is also freely pannable as a result.
Note that this code will currently have some issues when there are more than 4 BezTriples occurring on the same frame, but that should only happen when transforming keyframes anyway. This will be addressed as necessary.