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
The idea is to very quickly dismiss keys that are not a match when searching through an object.
Suppose that the target has at least 7 bytes.
Pick up a 64-bit word. Copy up to 8 characters from the target to the this 64-bit word, terminating with a quote if possible. Let us call this word FILTER.
Go through the keys. Load a 64-bit word (always safe because of padding) at that location. Do an XOR with FILTER. You get zero if and only if the first 8 characters match (including possible the quote). If so, investigate further, if not move on.
If the target has fewer than 7 bytes, then you need to use a mask, but there are only 7 cases so you can use a lookup table or some other cleverness.
@jkeiser Right. So I imagine a template where you pass a "matcher" which returns true if and only if the string matches. The idea is to do more work upfront building a matching instance. Ultimately, you could do regex!!!
The idea is to very quickly dismiss keys that are not a match when searching through an object.
Suppose that the target has at least 7 bytes.
Pick up a 64-bit word. Copy up to 8 characters from the target to the this 64-bit word, terminating with a quote if possible. Let us call this word FILTER.
Go through the keys. Load a 64-bit word (always safe because of padding) at that location. Do an XOR with FILTER. You get zero if and only if the first 8 characters match (including possible the quote). If so, investigate further, if not move on.
If the target has fewer than 7 bytes, then you need to use a mask, but there are only 7 cases so you can use a lookup table or some other cleverness.
See #1485
The text was updated successfully, but these errors were encountered: