> On Sep 11, 2019, at 11:53 AM, Robert Elz <[email protected]> wrote:
>
> Date: Wed, 11 Sep 2019 09:43:18 +0300
> From: Jason Thorpe <[email protected]>
> Message-ID: <[email protected]>
>
> | Another advantage of de-duping the name strings is that you can
> | compare names by testing pointer equivalence.
>
> That works only if string you're comparing against the cache entry
> is itself a cache entry, which would mean a whole new data struct
> to make lookup of those strings fast (as it is now, comparisons get
> a pointer to the string in the cache, and simply compare it with the
> lookup string .. only insert (which is relatively rare) would need to
> search the string cache to see if a name is already there, so that can
> use a slow algorithm, with no extra data struct to manage.
True, you'd have to "create a de-dup'd string" to compare it to other de-dup'd
strings using the pointer-equivalence method. There's probably a string length
threshold where that makes sense to do, and below that where it doesn't.
-- thorpej