
Vstr: C string library designed to work optimally with vector I/O - lelf
http://www.and.org/vstr/
======
tyingq
Sds from Antirez has a lot of the same features (not all), and is kept updated
since it's used by redis and other projects.
[https://github.com/antirez/sds/blob/master/README.md](https://github.com/antirez/sds/blob/master/README.md)

Vstr appears to have last been updated in 2006. It does have a comparison of
different string libraries, though that's also dated:
[http://www.and.org/vstr/comparison](http://www.and.org/vstr/comparison)

~~~
optimuspaul
2006 being the last update makes me not want to use it. But I suspect it is a
stable library that doesn't need much update. I'm just getting back into c/c++
development and I'm very interested in libraries like these.

~~~
robobro
> 2006 being the last update makes me not want to use it. Why

~~~
optimuspaul
security concerns, might be unfounded, but something to consider

------
joosters
Are these claims of O(1) behavior accurate? They might not be O(n), where n is
the length of the string, but they sound likely to be O(v), where v is the
number of 'iovec chunks' that the string is using (which could get large,
depending upon how you are building up your strings)

~~~
kevingadd
If your strings are short that's basically O(1), which could be nice for some
workloads - enums, json keys, etc.

~~~
leetcrew
if all your strings are of size < c, you can do any string operation on a
single string in constant time.

~~~
saagarjha
There are certain (randomized) operations that you can’t…

