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 ability to iterate over the values in a patricia whose keys begin with a certain prefix is a very valuable feature, especially if the number of elements with that prefix is much smaller than the number of elements in the patricia as a whole. The structure of a patricia lends itself nicely to this sort of operation.
ircd-micro was recently ported to libmowgli. As part of this port, all uses of micro's trie were replaced with mowgli patricias. micro's trie had the above feature, and it was used when iterating over the users on a particular server. This could be done by iterating over users_by_uid with the server's SID as the prefix. After the port, this was accomplished by iterating over users_by_uid and performing strncmp, which is slightly slower (but not slow enough to be a big deal at this point, really).
Another practical application of such a feature would be Atheme metadata. Object metadata in Atheme is often namespaced with colons, such as "private:userhost" or "private:closer". Being able to iterate over only pairs starting with "private:" or "private:userhost:" would be a useful capability. It wouldn't be much of a speedup, but would result in clearer code.
The text was updated successfully, but these errors were encountered:
The ability to iterate over the values in a patricia whose keys begin with a certain prefix is a very valuable feature, especially if the number of elements with that prefix is much smaller than the number of elements in the patricia as a whole. The structure of a patricia lends itself nicely to this sort of operation.
ircd-micro was recently ported to libmowgli. As part of this port, all uses of micro's trie were replaced with mowgli patricias. micro's trie had the above feature, and it was used when iterating over the users on a particular server. This could be done by iterating over users_by_uid with the server's SID as the prefix. After the port, this was accomplished by iterating over users_by_uid and performing strncmp, which is slightly slower (but not slow enough to be a big deal at this point, really).
Another practical application of such a feature would be Atheme metadata. Object metadata in Atheme is often namespaced with colons, such as "private:userhost" or "private:closer". Being able to iterate over only pairs starting with "private:" or "private:userhost:" would be a useful capability. It wouldn't be much of a speedup, but would result in clearer code.
The text was updated successfully, but these errors were encountered: