StringChain -- a data structure for managing large sequences of chunks of bytes

Steven D'Aprano steven at REMOVE.THIS.cybersource.com.au
Mon Mar 22 04:07:49 EDT 2010


On Sun, 21 Mar 2010 23:09:46 -0600, Zooko O'Whielacronx wrote:

> But the use case that I am talking about is where you need to accumulate
> new incoming strings into your buffer while alternately processing
> leading prefixes of the buffer.
[...]
> Below are the abbreviated results of the benchmark. You can easily run
> this benchmark yourself by following the README.txt in the StringChain
> source package [3]. These results show that for the load imposed by this
> benchmark StringChain is the only one of the four that scales and that
> it is also nice and fast.

I was reading this email, and thinking "Why do you need this StringChain 
data structure, from the description it sounds like a job for 
collections.deque?"

And funnily enough, following the links you supplied I came across this:

"You can get the package from  http://pypi.python.org/pypi/stringchain or 
with darcs get http://tahoe-lafs.org/source/stringchain/trunk. It has 
unit tests. It is in pure Python (it uses collections.deque and string)."

http://tahoe-lafs.org/trac/stringchain


Perhaps you should have said that it was a wrapper around deque giving 
richer functionality, rather than giving the impression that it was a 
brand new data structure invented by you. People are naturally going to 
be more skeptical about a newly invented data structure than one based on 
a reliable, component like deque.

In any case, it looks to me that the StringChain data structure itself is 
a little too application specific for me to be personally interested in 
it. Maybe you should consider linking to it on PyPI and seeing if there 
is any interest from others?



Regards,





Steven



More information about the Python-list mailing list