Better caching to avoid O(n^2) cases.
Created attachment 445829 [details] Patch
Committed r286494 (244833@main): <https://commits.webkit.org/244833@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 445829 [details].
<rdar://problem/86020744>