You can't cache ns_sets with ns_cache even with the -persist
flag. ns_sets are thread local and the ns_cache used by util_memoize is not. Even if you use a thread local cache
there is no way to free the ns_set if the handle gets flushed. And besides, you don't want to cache this on a per thread basis. Anyway, I think unless there is some really good
reason to use ns_sets (and I don't see one having looked at how this is being used), I think you would be better off
caching a list of lists anyway.