Re: [Nautilus-list] Rename Eel

iain wrote:
> After I fiddled with things (caching the tail of the list, keeping a
> count of the number of items internally, changing the slist into a list
> and adding an accessor function to retrieve the list from the
> private[3]) I got these results:

The whole point of the string list data structure is that the details
are hidden, so adding a getter to expose them is a bad idea.

The huge test you did with the list might be interesting for
benchmarking, but I think its misusing the string list.  The number one
reason to use the string list is for convenience, not for speed.  For
example, the nth string getter always returns duplicated strings, not
references.  This makes things definitely slower, but the ownership
rules for the string list are clear and you never have to wonder what to
do with returned nth strings.

Changing the internals to make things faster is fine.  Of course this
always depends on the intended use of the data structure.  There is a
lot of test code for the string list, so if you make changes to the
internals and pass 'make check' you can have a good level of confidence
that you haven't broken anything.

Also, in Nautilus' and Eel's use of string list we haven't really found
it to be a bottleneck.  Part of the reason why i made the internals
private was so that if in the future we did find it to be a bottleneck,
we could change the implementation details.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]