Closed mattmassicotte closed 1 month ago
Learnd a few things.
strictIntersection
Ok so while Glyph's implementation definitely is superior in a number of ways, the core problem was caused by the initializer.
let range = NSRange(0..<1_000_000)
// this is very slow
_ = IndexSet(range)
// this is very fast
_ = NSIndexSet(indexesIn: range) as IndexSet
So now this now very much better with f3c717b5bbf2118aa93f16a0aa4adf9a9c39ad43
TextViewSystemInterface.visibleSet
can be an expensive call. Actually computing the visible range in TextKit 1 doesn't seem to be an issue, but the system is spending a lot of time transforming this range into a set.I wonder if caching could help here.