You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The idea is to use smallvec for buffer while extracting strings from file.
We only consider the strings which are longer than 4 characters, so for other strings, which we are going to reject anyway, we can avoid heap allocation caused due to buffer vector. here.
letmut buffer:SmallVec<[u8;4]> = smallvec![];// TODO: change 4 to more optimal number
So, what to do?
Change Vec to SmallVec
Experiment with different sizes ( at least 4 will be good imho, but we should try other using quasi-doubling strategy , i.e. 4, 8, 16, 32 )
Benchmark the code to see if it actually improves performance.
Choose the one with best performance. ( post the results here or while making PR )
It would be amazing if you can post benchmark of all sizes, then we can choose the most optimal.
The text was updated successfully, but these errors were encountered:
The idea is to use smallvec for buffer while extracting strings from file.
We only consider the strings which are longer than 4 characters, so for other strings, which we are going to reject anyway, we can avoid heap allocation caused due to buffer vector. here.
So, what to do?
Vec
toSmallVec
It would be amazing if you can post benchmark of all sizes, then we can choose the most optimal.
The text was updated successfully, but these errors were encountered: