You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.
It was timing out in CI, so I investigated where all the time went.
Around 60-80% of the time is in case-insensitive string comparisons; evidently Go's handling of Unicode makes this expensive.
The total number of entries managed by nameservers in the test goes up linearly with the number of iterations. For each iteration there is then a linear function of comparisons in IsSorted() and merge() and an n log n function in Sort(), although the test only ever sorts nontrivial arrays in the periodic gossip. For low-thousands numbers of iterations the IsSorted() and merge() ones are more expensive.
Thoughts on ways to speed it up:
We could cache the ToLower output, trade memory for CPU.
merge() could use binary search to find the insertion points; generally the incoming data is far smaller than the existing data.
Since DNS has special considerations for Unicode characters, it may be that the full generality of case-insensitive handling is unnecessary.
The next-highest impact seems to be garbage collection, but I didn't investigate that.
The text was updated successfully, but these errors were encountered:
It was timing out in CI, so I investigated where all the time went.
Around 60-80% of the time is in case-insensitive string comparisons; evidently Go's handling of Unicode makes this expensive.
The total number of entries managed by nameservers in the test goes up linearly with the number of iterations. For each iteration there is then a linear function of comparisons in
IsSorted()
andmerge()
and an n log n function inSort()
, although the test only ever sorts nontrivial arrays in the periodic gossip. For low-thousands numbers of iterations theIsSorted()
andmerge()
ones are more expensive.Thoughts on ways to speed it up:
ToLower
output, trade memory for CPU.merge()
could use binary search to find the insertion points; generally the incoming data is far smaller than the existing data.The next-highest impact seems to be garbage collection, but I didn't investigate that.
The text was updated successfully, but these errors were encountered: