#5 better String management

开启中
j3tracey1 年之前创建 · 2 条评论

Our data structures and function/method signatures make a lot of use of Strings. This is good enough to work, but since essentially none of these strings are ever modified, we can probably save a lot on memory and performance by avoiding copies using &str and interned strings (though given how short most of these strings likely are, it's possible the overhead of the latter would be too heavy).

Our data structures and function/method signatures make a lot of use of `String`s. This is good enough to work, but since essentially none of these strings are ever modified, we can probably save a lot on memory and performance by avoiding copies using `&str` and interned strings (though given how short most of these strings likely are, it's possible the overhead of the latter would be too heavy).
Justin Tracey 评论于 1 年之前
所有者

Thinking about it a bit more, I think there is definitely some string interning we want to do, at the very least for onion addresses. This readme has some comparisons of features, but not performance. I don't think we actually need multithreaded interning, at least for clients and peers, since we should be getting all strings we'll encounter at initialization. The server might though, since it doesn't have an explicit registration phase (though we could also just not intern on the server).

Thinking about it a bit more, I think there is definitely some string interning we want to do, at the very least for onion addresses. [This readme](https://docs.rs/simple-interner/latest/simple_interner/) has some comparisons of features, but not performance. I don't think we actually need multithreaded interning, at least for clients and peers, since we should be getting all strings we'll encounter at initialization. The server might though, since it doesn't have an explicit registration phase (though we could also just not intern on the server).
Justin Tracey 评论于 1 年之前
所有者

Partially addressed by 67225eb8b5.

Partially addressed by 67225eb8b5.
登录 并参与到对话中。
未选择里程碑
未指派成员
1 名参与者
正在加载...
取消
保存
这个人很懒,什么都没留下。